X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fvcard_edit.c;h=d9537cb42c4586479f835fb689b04abdb787091f;hb=0af85763b23dfbefdc9faee3b62651046084ae22;hp=ae513934c68f2ad65c1d92087b1ad22f4aad1115;hpb=35f9e6feddac7af888f49a86c7c44d6bbc9cda36;p=citadel.git diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index ae513934c..d9537cb42 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -29,47 +29,6 @@ void nametab(char *tabbuf, long len, char *name) { } -/* - * display the adressbook overview - */ -void display_addressbook(long msgnum, char alpha) { - //char buf[SIZ]; - /* char mime_partnum[SIZ]; */ - ///char mime_disposition[SIZ]; - //int mime_length; - char vcard_partnum[SIZ]; - StrBuf *vcard_source = NULL; - message_summary summ;////TODO: this will leak - - memset(&summ, 0, sizeof(summ)); - // safestrncpy(summ.subj, _("(no subject)"), sizeof summ.subj); - // Load Message headers - if (!IsEmptyStr(vcard_partnum)) { - vcard_source = load_mimepart(msgnum, vcard_partnum); - if (vcard_source != NULL) { - - /* Display the summary line */ - display_vcard(WC->WBuf, vcard_source, alpha, 0, NULL, msgnum); - - /* If it's my vCard I can edit it */ - if ( (!strcasecmp(ChrPtr(WC->CurRoom.name), USERCONFIGROOM)) - || (!strcasecmp(&(ChrPtr(WC->CurRoom.name)[11]), USERCONFIGROOM)) - || (WC->CurRoom.view == VIEW_ADDRESSBOOK) - ) { - wc_printf("", - msgnum, vcard_partnum); - wc_printf("[%s]", _("edit")); - } - - FreeStrBuf(&vcard_source); - } - } - -} - - - /* * If it's an old "Firstname Lastname" style record, try to convert it. */ @@ -148,7 +107,7 @@ void fetch_ab_name(message_summary *Msg, char **namebuf) { return; /* Grab the name off the card */ - display_vcard(WC->WBuf, VCMime->Data, 0, 0, namebuf, Msg->msgnum); + display_vcard(WC->WBuf, VCMime, 0, 0, namebuf, Msg->msgnum); if (*namebuf != NULL) { lastfirst_firstlast(*namebuf); @@ -284,7 +243,8 @@ void fetchname_parsed_vcard(struct vCard *v, char **storename) { * full display all items of the vcard? * msgnum Citadel message pointer */ -void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, long msgnum) { +void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, wc_mime_attachment *Mime) +{ int i, j; char buf[SIZ]; char *name; @@ -539,7 +499,7 @@ void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, long msgnum * msgnum Citadel message pointer */ void display_vcard(StrBuf *Target, - StrBuf *vcard_source, + wc_mime_attachment *Mime, char alpha, int full, char **storename, @@ -551,7 +511,7 @@ void display_vcard(StrBuf *Target, StrBuf *Buf2; char this_alpha = 0; - v = VCardLoad(vcard_source); + v = VCardLoad(Mime->Data); if (v == NULL) return; @@ -568,12 +528,12 @@ void display_vcard(StrBuf *Target, if (storename != NULL) { fetchname_parsed_vcard(v, storename); } - else if ( - (alpha == 0) - || ((isalpha(alpha)) && (tolower(alpha) == tolower(this_alpha))) - || ((!isalpha(alpha)) && (!isalpha(this_alpha))) - ) { - display_parsed_vcard(Target, v, full,msgnum); + else if ((alpha == 0) || + ((isalpha(alpha)) && (tolower(alpha) == tolower(this_alpha))) || + ((!isalpha(alpha)) && (!isalpha(this_alpha))) + ) + { + display_parsed_vcard(Target, v, full, Mime); } vcard_free(v);