From 013c587bf5ad95282ad766b363d8734e99522052 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 19 Jun 2009 20:57:10 +0000 Subject: [PATCH] * locate_user_vcard_in_this_room() lost the ability to return the msgnum of the vcard it found during one of the recent overhauls. Fixed. The 'update your contact information' link wasn't working at all. --- webcit/auth.c | 6 ++++-- webcit/preferences.c | 11 ++++++----- webcit/useredit.c | 7 ++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index a4837d931..663f3d246 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -741,8 +741,8 @@ void validate(void) void display_reg(int during_login) { StrBuf *Buf; - message_summary *VCMsg; - wc_mime_attachment *VCAtt; + message_summary *VCMsg = NULL; + wc_mime_attachment *VCAtt = NULL; long vcard_msgnum; Buf = NewStrBuf(); @@ -777,6 +777,8 @@ void display_reg(int during_login) else { do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "display_main_menu", USERCONFIGROOM); } + + /* FIXME don't we have to free VCMsg and VCAtt ?? */ } diff --git a/webcit/preferences.c b/webcit/preferences.c index ac4fb3c48..0fdb07d41 100644 --- a/webcit/preferences.c +++ b/webcit/preferences.c @@ -247,23 +247,24 @@ void load_preferences(void) FreeStrBuf(&ReadBuf); } -/** - * \brief Goto the user's configuration room, creating it if necessary. - * \return 0 on success or nonzero upon failure. +/* + * Goto the user's configuration room, creating it if necessary. + * returns 0 on success or nonzero upon failure. */ int goto_config_room(StrBuf *Buf) { serv_printf("GOTO %s", USERCONFIGROOM); StrBuf_ServGetln(Buf); - if (GetServerStatus(Buf, NULL) != 2) { /* try to create the config room if not there */ + if (GetServerStatus(Buf, NULL) != 2) { /* try to create the config room if not there */ serv_printf("CRE8 1|%s|4|0", USERCONFIGROOM); StrBuf_ServGetln(Buf); GetServerStatus(Buf, NULL); serv_printf("GOTO %s", USERCONFIGROOM); StrBuf_ServGetln(Buf); - if (GetServerStatus(Buf, NULL) != 2) + if (GetServerStatus(Buf, NULL) != 2) { return(1); + } } return(0); } diff --git a/webcit/useredit.c b/webcit/useredit.c index b3a9a16b3..189d4c2cb 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -413,18 +413,17 @@ long locate_user_vcard_in_this_room(message_summary **VCMsg, wc_mime_attachment void *vMsg; message_summary *Msg; wc_mime_attachment *Att; - int Done; StrBuf *Buf; long vcard_msgnum = (-1L); int already_tried_creating_one = 0; StrBuf *FoundCharset = NewStrBuf(); StrBuf *Error = NULL; - + Buf = NewStrBuf(); TRYAGAIN: Done = 0; - /** Search for the user's vCard */ + /* Search for the user's vCard */ if (load_msg_ptrs("MSGS ALL||||1", 1) > 0) { at = GetNewHashPos(WCC->summ, 0); while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) { @@ -447,6 +446,7 @@ TRYAGAIN: *VCMsg = Msg; if (Att->Data == NULL) { MimeLoadData(Att); + vcard_msgnum = Msg->msgnum; } } } @@ -456,6 +456,7 @@ TRYAGAIN: } DeleteHashPos(&at); } + /* If there's no vcard, create one */ if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) { already_tried_creating_one = 1; -- 2.30.2