From 25085ec2cf0f8a5d34cfb8906e43e2df18d0e0ed Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 10 Mar 2002 06:07:09 +0000 Subject: [PATCH] * Handle multiple Internet e-mail addresses in vCard editor --- webcit/ChangeLog | 4 +++- webcit/vcard_edit.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index fbdc01f65..cde9bd632 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 323.11 2002/03/10 06:07:09 ajc +* Handle multiple Internet e-mail addresses in vCard editor + Revision 323.10 2002/03/07 04:56:09 ajc * Final polish for initial round of vCard editing functions. Only show "edit" link when editing user's own vCard in the My Citadel Config> room. @@ -742,4 +745,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index 99c629d84..58047f7b8 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -55,6 +55,7 @@ void edit_vcard(void) { char country[SIZ]; char hometel[SIZ]; char worktel[SIZ]; + char inetemail[SIZ]; char extrafields[SIZ]; lastname[0] = 0; @@ -71,6 +72,7 @@ void edit_vcard(void) { country[0] = 0; hometel[0] = 0; worktel[0] = 0; + inetemail[0] = 0; extrafields[0] = 0; output_headers(1); @@ -160,6 +162,13 @@ void edit_vcard(void) { extract_token(worktel, value, 0, ';'); } + else if (!strcasecmp(key, "email;internet")) { + if (inetemail[0] != 0) { + strcat(inetemail, "\n"); + } + strcat(inetemail, value); + } + else { strcat(extrafields, key); strcat(extrafields, ":"); @@ -238,6 +247,14 @@ void edit_vcard(void) { "VALUE=\"%s\" MAXLENGTH=\"29\">\n", worktel); + wprintf("
Internet e-mail addresses:
" + "For addresses in the Citadel directory, " + "the topmost address will be used in outgoing mail." + "
" + "

\n"); + wprintf("\n"); @@ -255,6 +272,7 @@ void edit_vcard(void) { void submit_vcard(void) { char buf[SIZ]; + int i; if (strcmp(bstr("sc"), "OK")) { readloop("readnew"); @@ -290,6 +308,14 @@ void submit_vcard(void) { bstr("country") ); serv_printf("tel;home:%s", bstr("hometel") ); serv_printf("tel;work:%s", bstr("worktel") ); + + for (i=0; i 0) { + serv_printf("email;internet:%s", buf); + } + } + serv_printf("%s", bstr("extrafields") ); serv_puts("end:vcard"); serv_puts("000"); -- 2.39.2