X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fvcard_edit.c;h=950fae6f43671e43fb53a16449eacd4390554b48;hb=5d38a76f8f06640e3a3f097d584ac52336110f7c;hp=f5c6ebb20acc31327bd803f6b374be910b5cc9d5;hpb=fcb8c4169baa629eb3c1a4979c7c8c32f1560389;p=citadel.git
diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c
index f5c6ebb20..950fae6f4 100644
--- a/webcit/vcard_edit.c
+++ b/webcit/vcard_edit.c
@@ -1,9 +1,20 @@
+/*
+ * Copyright (c) 1996-2012 by the citadel.org team
+ *
+ * This program is open source software. You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
#include "webcit.h"
#include "webserver.h"
#include "calendar.h"
-
+CtxType CTX_VCARD = CTX_NONE;
ConstStr VCStr [] = {
{HKEY("n")}, /* N is name, but only if there's no FN already there */
@@ -235,7 +246,7 @@ void fetchname_parsed_vcard(struct vCard *v, char **storename) {
}
}
if (is_qp) {
- // %ff can become 6 bytes in utf8
+ /* %ff can become 6 bytes in utf8 */
*storename = malloc(len * 2 + 3);
j = CtdlDecodeQuotedPrintable(
*storename, name,
@@ -243,7 +254,7 @@ void fetchname_parsed_vcard(struct vCard *v, char **storename) {
(*storename)[j] = 0;
}
else if (is_b64) {
- // ff will become one byte..
+ /* ff will become one byte.. */
*storename = malloc(len + 50);
CtdlDecodeBase64(
*storename, name,
@@ -488,7 +499,7 @@ void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, wc_mime_att
if (pass == 1) {
StrBufAppendPrintf(Target, "
"
""
- ""
+ ""
"");
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
@@ -645,7 +651,7 @@ TODO: check for layer II
void tmplput_VCARD_ITEM(StrBuf *Target, WCTemplputParams *TP)
{
- HashList *VC = CTX;
+ HashList *VC = CTX(CTX_VCARD);
eVC evc;
void *vStr;
@@ -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);
@@ -864,6 +870,7 @@ void do_edit_vcard(long msgnum, char *partnum,
wc_mime_attachment *VCAtt,
const char *return_to,
const char *force_room) {
+ wcsession *WCC = WC;
message_summary *Msg = NULL;
wc_mime_attachment *VCMime = NULL;
struct vCard *v;
@@ -1032,9 +1039,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(" |