From 130b56b0a2c4efc253d4383f81052bff32fce6c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 2 Mar 2009 22:24:09 +0000 Subject: [PATCH] * fix display of quoted-printable names in addressbook views --- webcit/messages.c | 7 +++-- webcit/vcard_edit.c | 74 ++++++++++++++++++++++++++++++++++++--------- webcit/webcit.h | 4 +-- 3 files changed, 66 insertions(+), 19 deletions(-) diff --git a/webcit/messages.c b/webcit/messages.c index d60b2eefb..c3303792b 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -663,6 +663,7 @@ void readloop(long oper) int sortit = 0; int defaultsortorder = 0; WCTemplputParams SubTP; + char *ab_name; if (havebstr("is_summary") && (1 == (ibstr("is_summary")))) WCC->wc_view = VIEW_MAILBOX; @@ -852,13 +853,15 @@ void readloop(long oper) display_note(Msg, Msg->is_new); break; case VIEW_ADDRESSBOOK: - fetch_ab_name(Msg, buf); + ab_name = NULL; + fetch_ab_name(Msg, &ab_name); ++num_ab; addrbook = realloc(addrbook, (sizeof(addrbookent) * num_ab) ); - safestrncpy(addrbook[num_ab-1].ab_name, buf, + safestrncpy(addrbook[num_ab-1].ab_name, ab_name, sizeof(addrbook[num_ab-1].ab_name)); addrbook[num_ab-1].ab_msgnum = Msg->msgnum; + free(ab_name); break; case VIEW_BBS: /* Tag the mails we want to show in bbview... */ default: diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index 97ef83fa9..3a983ac4c 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -58,7 +58,7 @@ void display_addressbook(long msgnum, char alpha) { if (vcard_source != NULL) { /** Display the summary line */ - display_vcard(WC->WBuf, vcard_source, alpha, 0, NULL,msgnum); + display_vcard(WC->WBuf, vcard_source, alpha, 0, NULL, msgnum); /** If it's my vCard I can edit it */ if ( (!strcasecmp(ChrPtr(WC->wc_roomname), USERCONFIGROOM)) @@ -105,7 +105,7 @@ void lastfirst_firstlast(char *namebuf) { * \param msgnum the citadel message number * \param namebuf where to put the name in??? */ -void fetch_ab_name(message_summary *Msg, char *namebuf) { +void fetch_ab_name(message_summary *Msg, char **namebuf) { char buf[SIZ]; char mime_partnum[SIZ]; char mime_filename[SIZ]; @@ -118,7 +118,6 @@ void fetch_ab_name(message_summary *Msg, char *namebuf) { message_summary summ;/// TODO this will lak if (namebuf == NULL) return; - strcpy(namebuf, ""); memset(&summ, 0, sizeof(summ)); //////safestrncpy(summ.subj, "(no subject)", sizeof summ.subj); @@ -154,14 +153,19 @@ void fetch_ab_name(message_summary *Msg, char *namebuf) { free(vcard_source); } } - - lastfirst_firstlast(namebuf); - striplt(namebuf); - len = strlen(namebuf); - for (i=0; i