- serv_puts("MSGS ALL");
- serv_getln(buf, sizeof buf);
- if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- ptr = malloc(sizeof(struct stuff_t));
- ptr->msgnum = atol(buf);
- ptr->next = stuff;
- stuff = ptr;
- }
-
- /** Iterate through the message list looking for vCards */
- while (stuff != NULL) {
- serv_printf("MSG0 %ld|2", stuff->msgnum);
- serv_getln(buf, sizeof buf);
- if (buf[0]=='1') {
- while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- if (!strncasecmp(buf, "part=", 5)) {
- extract_token(partnum, &buf[5], 2, '|', sizeof partnum);
- extract_token(content_type, &buf[5], 4, '|', sizeof content_type);
- if ( (!strcasecmp(content_type, "text/x-vcard"))
- || (!strcasecmp(content_type, "text/vcard")) ) {
- vcard_msgnum = stuff->msgnum;
+ if (load_msg_ptrs("MSGS ALL||||1", 1) > 0) {
+ at = GetNewHashPos(WCC->summ, 0);
+ while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
+ Msg = (message_summary*) vMsg;
+ Msg->MsgBody = (wc_mime_attachment*) malloc(sizeof(wc_mime_attachment));
+ memset(Msg->MsgBody, 0, sizeof(wc_mime_attachment));
+ Msg->MsgBody->msgnum = Msg->msgnum;
+
+ load_message(Msg,
+ FoundCharset,
+ &Error);
+
+ if (Msg->AllAttach != NULL) {
+ att = GetNewHashPos(Msg->AllAttach, 0);
+ while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg)) {
+ Att = (wc_mime_attachment*) vMsg;
+ if ( (strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0) ||
+ (strcasecmp(ChrPtr(Att->ContentType), "text/vcard") == 0) ) {
+ *VCAtt = Att;
+ *VCMsg = Msg;
+ if (Att->Data == NULL)
+ MimeLoadData(Att);