]> code.citadel.org Git - citadel.git/blobdiff - webcit/useredit.c
* split tasks view into its own file
[citadel.git] / webcit / useredit.c
index b3a9a16b35efc63167066c827a183bf0a610dc3f..7d0c6cc8f74167fa046fe37dbcc315c68be29dd5 100644 (file)
@@ -413,19 +413,21 @@ long locate_user_vcard_in_this_room(message_summary **VCMsg, wc_mime_attachment
        void *vMsg;
        message_summary *Msg;
        wc_mime_attachment *Att;
-
        int Done;
        StrBuf *Buf;
        long vcard_msgnum = (-1L);
        int already_tried_creating_one = 0;
        StrBuf *FoundCharset = NewStrBuf();
        StrBuf *Error = NULL;
-       
+       SharedMessageStatus Stat;
+
+
        Buf = NewStrBuf();
 TRYAGAIN:
+       memset(&Stat, 0, sizeof(SharedMessageStatus));
        Done = 0;
-       /** Search for the user's vCard */
-       if (load_msg_ptrs("MSGS ALL||||1", 1) > 0) {
+       /* Search for the user's vCard */
+       if (load_msg_ptrs("MSGS ALL||||1", &Stat) > 0) {
                at = GetNewHashPos(WCC->summ, 0);
                while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
                        Msg = (message_summary*) vMsg;          
@@ -447,15 +449,18 @@ TRYAGAIN:
                                                *VCMsg = Msg;
                                                if (Att->Data == NULL) {
                                                        MimeLoadData(Att);
+                                                       vcard_msgnum = Msg->msgnum;
                                                }
                                        }
                                }
+                               DeleteHashPos(&att);
                        }
                        FreeStrBuf(&Error);     /* don't care... */
                        
                }
                DeleteHashPos(&at);             
        }
+
        /* If there's no vcard, create one */
        if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
                already_tried_creating_one = 1;