"
""
- ""
+ ""
"");
StrEscAppend(Target, NULL, fullname, 0, 0);
StrBufAppendPrintf(Target, "");
@@ -544,36 +555,31 @@ void parse_vcard(StrBuf *Target, struct vCard *v, HashList *VC, int full, wc_mim
StrBuf *Swap = NULL;
int i, j;
char buf[SIZ];
- char *name;
int is_qp = 0;
int is_b64 = 0;
StrBuf *thisname = NULL;
- char *thisvalue = NULL;
char firsttoken[SIZ];
- int pass;
- long len;
void *V;
Swap = NewStrBuf ();
thisname = NewStrBuf();
for (i=0; i<(v->numprops); ++i) {
- int len;
is_qp = 0;
is_b64 = 0;
StrBufPlain(thisname, v->prop[i].name, -1);
StrBufLowerCase(thisname);
- len = extract_token(firsttoken, thisname, 0, ';', sizeof firsttoken);
+ /*len = */extract_token(firsttoken, ChrPtr(thisname), 0, ';', sizeof firsttoken);
- for (j=0; jprop[i].value);
@@ -601,11 +607,11 @@ void parse_vcard(StrBuf *Target, struct vCard *v, HashList *VC, int full, wc_mim
{
eVC evc = (eVC) V;
Put(VC, IKEY(evc), Val, HFreeStrBuf);
- lprintf(1, "[%ld]\n", evc);
+ syslog(1, "[%ul]\n", evc);
Val = NULL;
}
else
- lprintf(1, "[]\n");
+ syslog(1, "[]\n");
/*
TODO: check for layer II
else
@@ -730,7 +736,7 @@ void display_vcard(StrBuf *Target,
((!isalpha(alpha)) && (!isalpha(this_alpha)))
)
{
-#ifdef TECH_PREVIEW
+#ifdef XXX_XXX
new_vcard (Target, v, full, Mime);
#else
display_parsed_vcard(Target, v, full, Mime);
@@ -763,7 +769,7 @@ void do_addrbook_view(addrbookent *addrbook, int num_ab) {
char **tablabels;
if (num_ab == 0) {
- wc_printf("
");
+ wc_printf("
");
wc_printf(_("This address book is empty."));
wc_printf(" \n");
return;
@@ -777,7 +783,7 @@ void do_addrbook_view(addrbookent *addrbook, int num_ab) {
tablabels = malloc(num_pages * sizeof (char *));
if (tablabels == NULL) {
- wc_printf("
");
+ wc_printf("
");
wc_printf(_("An internal error has occurred."));
wc_printf(" \n");
return;
@@ -1032,9 +1038,9 @@ void do_edit_vcard(long msgnum, char *partnum,
/* Display the form */
output_headers(1, 1, 1, 0, 0, 0);
- do_template("beginbox_1", NULL);
+ do_template("box_begin_1");
StrBufAppendBufPlain(WC->WBuf, _("Edit contact information"), -1, 0);
- do_template("beginbox_2", NULL);
+ do_template("box_begin_2");
wc_printf(" |
\n");
- do_template("endbox", NULL);
+ do_template("box_end");
wDumpContent(1);
if (Msg != NULL) {
DestroyMessageSummary(Msg);
@@ -1231,11 +1237,11 @@ void edit_vcard(void) {
* parse edited vcard from the browser
*/
void submit_vcard(void) {
- wcsession *WCC = WC;
struct vCard *v;
char *serialized_vcard;
char buf[SIZ];
StrBuf *Buf;
+ const StrBuf *ForceRoom;
int i;
if (!havebstr("ok_button")) {
@@ -1244,19 +1250,13 @@ void submit_vcard(void) {
}
if (havebstr("force_room")) {
- if (gotoroom(sbstr("force_room")) != 200) {
- StrBufAppendBufPlain(WCC->ImportantMsg,
- _("Unable to enter the room to save your message"),
- -1, 0);
- StrBufAppendBufPlain(WCC->ImportantMsg,
- HKEY(": "), 0);
- StrBufAppendBuf(WCC->ImportantMsg, sbstr("force_room"), 0);
- StrBufAppendBufPlain(WCC->ImportantMsg,
- HKEY("; "), 0);
-
- StrBufAppendBufPlain(WCC->ImportantMsg,
- _("Aborting."),
- -1, 0);
+ ForceRoom = sbstr("force_room");
+ if (gotoroom(ForceRoom) != 200) {
+ AppendImportantMessage(_("Unable to enter the room to save your message"), -1);
+ AppendImportantMessage(HKEY(": "));
+ AppendImportantMessage(SKEY(ForceRoom));
+ AppendImportantMessage(HKEY("; "));
+ AppendImportantMessage(_("Aborting."), -1);
if (!strcmp(bstr("return_to"), "select_user_to_edit")) {
select_user_to_edit(NULL);
@@ -1274,27 +1274,23 @@ void submit_vcard(void) {
}
}
- sprintf(buf, "ENT0 1|||4||");
- serv_puts(buf);
- serv_getln(buf, sizeof buf);
- if (buf[0] != '4') {
+ Buf = NewStrBuf();
+ serv_write(HKEY("ENT0 1|||4||||||1\n"));
+ if (!StrBuf_ServGetln(Buf) && (GetServerStatus(Buf, NULL) != 4))
+ {
edit_vcard();
return;
}
/* Make a vCard structure out of the data supplied in the form */
- Buf = NewStrBuf();
StrBufPrintf(Buf, "begin:vcard\r\n%s\r\nend:vcard\r\n",
bstr("extrafields")
);
v = VCardLoad(Buf); /* Start with the extra fields */
- FreeStrBuf(&Buf);
if (v == NULL) {
- safestrncpy(WCC->ImportantMessage,
- _("An error has occurred."),
- sizeof WCC->ImportantMessage
- );
+ AppendImportantMessage(_("An error has occurred."), -1);
edit_vcard();
+ FreeStrBuf(&Buf);
return;
}
@@ -1336,20 +1332,20 @@ void submit_vcard(void) {
serialized_vcard = vcard_serialize(v);
vcard_free(v);
if (serialized_vcard == NULL) {
- safestrncpy(WCC->ImportantMessage,
- _("An error has occurred."),
- sizeof WCC->ImportantMessage
- );
+ AppendImportantMessage(_("An error has occurred."), -1);
edit_vcard();
+ FreeStrBuf(&Buf);
return;
}
- serv_puts("Content-type: text/x-vcard; charset=UTF-8");
- serv_puts("");
+ serv_write(HKEY("Content-type: text/x-vcard; charset=UTF-8\n"));
+ serv_write(HKEY("\n"));
serv_printf("%s\r\n", serialized_vcard);
- serv_puts("000");
+ serv_write(HKEY("000\n"));
free(serialized_vcard);
+ StrBuf_ServGetln(Buf);
+
if (!strcmp(bstr("return_to"), "select_user_to_edit")) {
select_user_to_edit(NULL);
}
@@ -1362,6 +1358,7 @@ void submit_vcard(void) {
else {
readloop(readnew, eUseDefault);
}
+ FreeStrBuf(&Buf);
}
@@ -1414,7 +1411,9 @@ int vcard_GetParamsGetServerCall(SharedMessageStatus *Stat,
void **ViewSpecific,
long oper,
char *cmd,
- long len)
+ long len,
+ char *filter,
+ long flen)
{
vcardview_struct *VS;
@@ -1511,6 +1510,7 @@ InitModule_VCARD
VIEW_ADDRESSBOOK,
vcard_GetParamsGetServerCall,
NULL,
+ NULL,
NULL,
vcard_LoadMsgFromServer,
vcard_RenderView_or_Tail,