if (Msg->AllAttach != NULL) {
att = GetNewHashPos(Msg->AllAttach, 0);
- while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg)) {
+ while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg) &&
+ (vcard_msgnum == -1)) {
Att = (wc_mime_attachment*) vMsg;
if (
(strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0)
) {
*VCAtt = Att;
*VCMsg = Msg;
+ vcard_msgnum = Msg->msgnum;
if (Att->Data == NULL) {
MimeLoadData(Att);
- vcard_msgnum = Msg->msgnum;
}
}
}
/* If there's no vcard, create one */
if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
+ FlushStrBuf(Buf);
already_tried_creating_one = 1;
serv_puts("ENT0 1|||4");
StrBuf_ServGetln(Buf);
serv_puts("end:vcard");
serv_puts("000");
}
+ else
+ lprintf(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
goto TRYAGAIN;
}
FreeStrBuf(&Buf);