* fixed several tiny flaws
authorWilfried Göesgens <willi@citadel.org>
Sat, 12 Jul 2008 20:20:52 +0000 (20:20 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 12 Jul 2008 20:20:52 +0000 (20:20 +0000)
webcit/groupdav_main.c
webcit/messages.c
webcit/preferences.c
webcit/webcit.h

index 651cdb28d956c7ea0360738b2a053d5b2a14e968..a05c05ad2dccc2c0fadc8774ee345faaf152f37e 100644 (file)
@@ -43,7 +43,7 @@ void euid_escapize(char *target, char *source) {
                        target[++target_length] = 0;
                }
                else {
-                       sprintf(&target[target_length], "=%02X", source[i]);
+                       sprintf(&target[target_length], "=%02X", (0xFF & source[i]));
                        target_length += 3;
                }
        }
index 3d20e3b148bddfdf776bc248073473cb662fd8c0..288acba144d3db7db52401a38b2a8dc7bcdada9e 100644 (file)
@@ -3279,6 +3279,7 @@ void display_enter(void)
        int is_anonymous = 0;
        long existing_page = (-1L);
        size_t dplen;
+       struct wcsession *WCC = WC;
 
        now = time(NULL);
 
@@ -3301,7 +3302,7 @@ void display_enter(void)
                recipient_required = 1;
        }
        else if (buf[0] != '2') {               /** Any other error means that we cannot continue */
-               sprintf(WC->ImportantMessage, "%s", &buf[4]);
+               sprintf(WCC->ImportantMessage, "%s", &buf[4]);
                readloop("readnew");
                return;
        }
@@ -3315,8 +3316,8 @@ void display_enter(void)
         * Are we perhaps in an address book view?  If so, then an "enter
         * message" command really means "add new entry."
         */
-       if (WC->wc_default_view == VIEW_ADDRESSBOOK) {
-               do_edit_vcard(-1, "", "", WC->wc_roomname);
+       if (WCC->wc_default_view == VIEW_ADDRESSBOOK) {
+               do_edit_vcard(-1, "", "", WCC->wc_roomname);
                return;
        }
 
@@ -3324,7 +3325,7 @@ void display_enter(void)
         * Are we perhaps in a calendar room?  If so, then an "enter
         * message" command really means "add new calendar item."
         */
-       if (WC->wc_default_view == VIEW_CALENDAR) {
+       if (WCC->wc_default_view == VIEW_CALENDAR) {
                display_edit_event();
                return;
        }
@@ -3333,7 +3334,7 @@ void display_enter(void)
         * Are we perhaps in a tasks view?  If so, then an "enter
         * message" command really means "add new task."
         */
-       if (WC->wc_default_view == VIEW_TASKS) {
+       if (WCC->wc_default_view == VIEW_TASKS) {
                display_edit_task();
                return;
        }
@@ -3404,13 +3405,13 @@ void display_enter(void)
                "name=\"enterform\""
                ">\n");
        wprintf("<input type=\"hidden\" name=\"postseq\" value=\"%ld\">\n", now);
-       if (WC->wc_view == VIEW_WIKI) {
+       if (WCC->wc_view == VIEW_WIKI) {
                wprintf("<input type=\"hidden\" name=\"wikipage\" value=\"%s\">\n", bstr("wikipage"));
        }
        wprintf("<input type=\"hidden\" name=\"return_to\" value=\"%s\">\n", bstr("return_to"));
-       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WCC->nonce);
        wprintf("<input type=\"hidden\" name=\"force_room\" value=\"");
-       escputs(WC->wc_roomname);
+       escputs(WCC->wc_roomname);
        wprintf("\">\n");
        wprintf("<input type=\"hidden\" name=\"references\" value=\"");
        escputs(bstr("references"));
@@ -3462,9 +3463,9 @@ void display_enter(void)
                }
        }
 
-       if (WC->room_flags & QR_ANONOPT) {
+       if (WCC->room_flags & QR_ANONOPT) {
                wprintf("<option %s value=\"__ANONYMOUS__\">%s</option>\n",
-                       ((!strcasecmp(bstr("__ANONYMOUS__"), WC->wc_fullname)) ? "selected" : ""),
+                       ((!strcasecmp(bstr("__ANONYMOUS__"), WCC->wc_fullname)) ? "selected" : ""),
                        _("Anonymous")
                );
        }
@@ -3491,7 +3492,7 @@ void display_enter(void)
        }
 
        wprintf(_(" <I>in</I> "));
-       escputs(WC->wc_roomname);
+       escputs(WCC->wc_roomname);
 
        wprintf("</td></tr>");
 
@@ -3600,7 +3601,7 @@ void display_enter(void)
        }
 
        /** If we're editing a wiki page, insert the existing page here... */
-       else if (WC->wc_view == VIEW_WIKI) {
+       else if (WCC->wc_view == VIEW_WIKI) {
                safestrncpy(buf, bstr("wikipage"), sizeof buf);
                str_wiki_index(buf);
                existing_page = locate_message_by_uid(buf);
@@ -3610,7 +3611,7 @@ void display_enter(void)
        }
 
        /** Insert our signature if appropriate... */
-       if ( (WC->is_mailbox) && yesbstr("sig_inserted") ) {
+       if ( (WCC->is_mailbox) && !yesbstr("sig_inserted") ) {
                int UseSig;
                get_pref_yesno("use_sig", &UseSig, 0);
                if (UseSig) {
@@ -3642,9 +3643,9 @@ void display_enter(void)
                                else if (*sig == '\'') {
                                        wprintf("&#39;");
                                }
-                               else if (isprint(*sig)) {
+                               else /* since we're utf 8, is this a good idea? if (isprint(*sig))*/ {
                                        wprintf("%c", *sig);
-                               }
+                               } 
                                sig ++;
                        }
                }
@@ -3667,7 +3668,7 @@ void display_enter(void)
        wprintf(_("Attachments:"));
        wprintf(" ");
        wprintf("<select name=\"which_attachment\" size=1>");
-       for (att = WC->first_attachment; att != NULL; att = att->next) {
+       for (att = WCC->first_attachment; att != NULL; att = att->next) {
                wprintf("<option value=\"");
                urlescputs(att->filename);
                wprintf("\">");
index c29ec1c0f43326bf50776120858ca8216f68c8d6..db35cedaeb4f56acbe6c0d915d5fded068009f34 100644 (file)
@@ -471,13 +471,13 @@ void display_preferences(void)
        );
 
        wprintf("<input type=\"radio\" id=\"no_sig\" name=\"use_sig\" VALUE=\"no\"");
-       if (UseSig) wprintf(" checked");
+       if (!UseSig) wprintf(" checked");
        wprintf(" onChange=\"show_or_hide_sigbox();\" >");
        wprintf(_("No signature"));
        wprintf("</input>&nbsp,&nbsp;&nbsp;\n");
 
        wprintf("<input type=\"radio\" id=\"yes_sig\" name=\"use_sig\" VALUE=\"yes\"");
-       if (!UseSig) wprintf(" checked");
+       if (UseSig) wprintf(" checked");
        wprintf(" onChange=\"show_or_hide_sigbox();\" >");
        wprintf(_("Use this signature:"));
        wprintf("<div id=\"signature_box\">"
index 51171f287154df318f38bc6277753f8a88c9d443..337063f5b2d3b5a25304ac4242b6c9ec49d8ae00 100644 (file)
@@ -705,7 +705,7 @@ void set_PREF_LONG(const char *key, size_t keylen, long value, int save_to_serve
 
 #define get_pref_yesno(a, b, c) get_PREF_YESNO(a, sizeof(a) - 1, b, c)
 int get_PREF_YESNO(const char *key, size_t keylen, int *value, int Default);
-#define set_pref_yesno(a, b, c) set_PREF_LONG(a, sizeof(a) - 1, b, c)
+#define set_pref_yesno(a, b, c) set_PREF_YESNO(a, sizeof(a) - 1, b, c)
 void set_PREF_YESNO(const char *key, size_t keylen, int value, int save_to_server);