Put our known stringlength into the mime parser so it doesn't need to strlen again.
[citadel.git] / citadel / modules / vcard / serv_vcard.c
index 393cf72101fbfd3fc1d1ebc58810234b6b7df84c..2722b3bca3a6da1ac6d854a1d743eab0819a7fc4 100644 (file)
@@ -329,7 +329,7 @@ void vcard_extract_vcard(char *name, char *filename, char *partnum, char *disp,
  * function accordingly (delete the user's existing vCard in the config room
  * and in the global address book).
  */
-int vcard_upload_beforesave(struct CtdlMessage *msg) {
+int vcard_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) {
        struct CitContext *CCC = CC;
        char *s;
        char buf[SIZ];
@@ -375,12 +375,11 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) {
 
        if (CM_IsEmpty(msg, eMesageText)) return(0);
 
-       mime_parser(msg->cm_fields[eMesageText],
-               NULL,
-               *vcard_extract_vcard,
-               NULL, NULL,
-               &v,             /* user data ptr - put the vcard here */
-               0
+       mime_parser(CM_RANGE(msg, eMesageText),
+                   *vcard_extract_vcard,
+                   NULL, NULL,
+                   &v,         /* user data ptr - put the vcard here */
+                   0
        );
 
        if (v == NULL) return(0);       /* no vCards were found in this message */
@@ -504,7 +503,7 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) {
  * function accordingly (copy the vCard from the config room to the global
  * address book).
  */
-int vcard_upload_aftersave(struct CtdlMessage *msg) {
+int vcard_upload_aftersave(struct CtdlMessage *msg, recptypes *recp) {
        struct CitContext *CCC = CC;
        char *ptr;
        int linelen;
@@ -1107,13 +1106,12 @@ void dvca_callback(long msgnum, void *userdata) {
 
        msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) return;
-       mime_parser(msg->cm_fields[eMesageText],
-               NULL,
-               *dvca_mime_callback,    /* callback function */
-               NULL, NULL,
-               NULL,                   /* user data */
-               0
-       );
+       mime_parser(CM_RANGE(msg, eMesageText),
+                   *dvca_mime_callback,        /* callback function */
+                   NULL, NULL,
+                   NULL,                       /* user data */
+                   0
+               );
        CM_Free(msg);
 }
 
@@ -1172,7 +1170,7 @@ void check_get(void) {
        
        if (strncasecmp(cmdbuf, "GET ", 4)==0)
        {
-               struct recptypes *rcpt;
+               recptypes *rcpt;
                char *argbuf = &cmdbuf[4];
                
                extract_token(internet_addr, argbuf, 0, '|', sizeof internet_addr);