* Shortened some of the string lengths in struct wcsession. We really don't
authorArt Cancro <ajc@citadel.org>
Thu, 1 Dec 2005 04:59:57 +0000 (04:59 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 1 Dec 2005 04:59:57 +0000 (04:59 +0000)
  need all those 4096 byte moby-buffers everywhere.

webcit/ChangeLog
webcit/iconbar.c
webcit/roomops.c
webcit/static/wclib.js
webcit/webcit.h

index c225cc25b3bcbbf7b970dedc4dfc1cca77becaa1..4e2da7653e8e44ab94c10fd5a92e9725bce54f7a 100644 (file)
@@ -1,5 +1,9 @@
 $Id$
 
+Wed Nov 30 23:59:11 EST 2005 ajc
+* Shortened some of the string lengths in struct wcsession.  We really don't
+  need all those 4096 byte moby-buffers everywhere.
+
 Tue Nov 29 23:53:33 EST 2005 ajc
 * Drag-and-drop move messages is now complete.
 
index ca37f213aca6bbdb7b578b24f65cedaaa4845586..f656a5191e330c562e2bac367896089f46056bff 100644 (file)
@@ -86,7 +86,10 @@ void do_iconbar(void) {
                _("CITADEL")
        );
 
-       wprintf("<li><a href=\"javascript:switch_to_room_list()\">switch to room list</a>\n");
+       wprintf("<li><div align=\"center\">"
+               "<a href=\"javascript:switch_to_room_list()\">switch to room list</a>"
+               "</div>"
+       );
 
        if (ib_summary) {
                wprintf("<li><a href=\"summary\" "
@@ -376,7 +379,10 @@ void do_iconbar_roomlist(void) {
                _("CITADEL")
        );
 
-       wprintf("<li><a href=\"javascript:switch_to_menu_buttons()\">back to menu...</a>");
+       wprintf("<li><div align=\"center\">"
+               "<a href=\"javascript:switch_to_menu_buttons()\">switch to menu</a>"
+               "</div>"
+       );
        
        wprintf("</ul>\n");
 
index d7a98a2a130a07781b4daf4b25ad9138a742c3f1..2ba648fec959da8c6d46f28b5e28cc45d7bed788 100644 (file)
@@ -6,16 +6,6 @@
 
 #include "webcit.h"
 
-struct folder {
-       int floor;
-       char room[SIZ];
-       char name[SIZ];
-       int hasnewmsgs;
-       int is_mailbox;
-       int selectable;
-       int view;
-};
-
 char floorlist[128][SIZ];
 
 char *viewdefs[6];
@@ -2538,17 +2528,14 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
        char buf[256];
        char floor_name[256];
        char old_floor_name[256];
-       char boxtitle[256];
+       char floordivtitle[256];
        int levels, oldlevels;
        int i, t;
-       int nf;
        int num_drop_targets = 0;
 
        strcpy(floor_name, "");
        strcpy(old_floor_name, "");
 
-       nf = num_floors;
-
        levels = 0;
        oldlevels = 0;
        for (i=0; i<max_folders; ++i) {
@@ -2567,10 +2554,10 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
 
                if (levels == 1) {
                        /* Begin floor */
-                       stresc(boxtitle, floor_name, 1, 0);
+                       stresc(floordivtitle, floor_name, 1, 0);
                        wprintf("<span class=\"ib_roomlist_floor\" "
                                "onClick=\"expand_floor('floordiv%d')\">"
-                               "%s</span><br>\n", i, boxtitle);
+                               "%s</span><br>\n", i, floordivtitle);
                        wprintf("<div id=\"floordiv%d\" style=\"display:none\">", i);
                }
 
index 2bf28597c5422a02c662d03305333b97f1484b5a..bbcd7c5d3ca9a15e8a1df0c599014864e0b1312c 100644 (file)
@@ -60,6 +60,7 @@ var drop_targets_elements = new Array();
 var drop_targets_roomnames = new Array();
 
 function switch_to_room_list() {
+       $('iconbar').innerHTML = $('iconbar').innerHTML.substr(0, $('iconbar').innerHTML.indexOf('switch'));
        new Ajax.Updater('iconbar', 'iconbar_ajax_rooms', { method: 'get' } );
 }
 
index 996def547be482eb99128457370a0962196bc39a..ec872805161c859b2f105133097ba429366f4b77 100644 (file)
@@ -260,6 +260,17 @@ struct message_summary {
        int is_new;
 };
 
+/* Data structure for roomlist-to-folderlist conversion */
+struct folder {
+       int floor;
+       char room[SIZ];
+       char name[SIZ];
+       int hasnewmsgs;
+       int is_mailbox;
+       int selectable;
+       int view;
+};
+
 /*
  * One of these is kept for each active Citadel session.
  * HTTP transactions are bound to one at a time.
@@ -267,9 +278,9 @@ struct message_summary {
 struct wcsession {
        struct wcsession *next;         /* Linked list */
        int wc_session;                 /* WebCit session ID */
-       char wc_username[SIZ];
-       char wc_password[SIZ];
-       char wc_roomname[SIZ];
+       char wc_username[128];
+       char wc_password[128];
+       char wc_roomname[256];
        int connected;
        int logged_in;
        int axlevel;
@@ -286,18 +297,18 @@ struct wcsession {
        long uglsn;
        int upload_length;
        char *upload;
-       char upload_filename[SIZ];
-       char upload_content_type[SIZ];
+       char upload_filename[PATH_MAX];
+       char upload_content_type[256];
        int new_mail;
        int remember_new_mail;
        int need_regi;                  /* This user needs to register. */
        int need_vali;                  /* New users require validation. */
-       char cs_inet_email[SIZ];        /* User's preferred Internet addr. */
+       char cs_inet_email[256];        /* User's preferred Internet addr. */
        pthread_mutex_t SessionMutex;   /* mutex for exclusive access */
        time_t lastreq;                 /* Timestamp of most recent HTTP */
        int killthis;                   /* Nonzero == purge this session */
        struct march *march;            /* march mode room list */
-       char reply_to[SIZ];             /* reply-to address */
+       char reply_to[512];             /* reply-to address */
 
        long msgarr[10000];             /* for read operations */
        int num_summ;
@@ -307,8 +318,8 @@ struct wcsession {
        struct urlcontent *urlstrings;
        int HaveInstantMessages;        /* Nonzero if incoming msgs exist */
        struct wcsubst *vars;
-       char this_page[SIZ];            /* address of current page */
-       char http_host[SIZ];            /* HTTP Host: header */
+       char this_page[512];            /* address of current page */
+       char http_host[512];            /* HTTP Host: header */
        char *preferences;
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
        struct disp_cal {
@@ -319,10 +330,10 @@ struct wcsession {
 #endif
        struct wc_attachment *first_attachment;
        char ImportantMessage[SIZ];
-       char last_chat_user[SIZ];
+       char last_chat_user[256];
        int ctdl_pid;                   /* Session ID on the Citadel server */
-       char httpauth_user[SIZ];        /* only for GroupDAV sessions */
-       char httpauth_pass[SIZ];        /* only for GroupDAV sessions */
+       char httpauth_user[256];        /* only for GroupDAV sessions */
+       char httpauth_pass[256];        /* only for GroupDAV sessions */
 
        size_t burst_len;
        char *burst;
@@ -552,6 +563,7 @@ void begin_ajax_response(void);
 void end_ajax_response(void);
 void initialize_viewdefs(void);
 void initialize_axdefs(void);
+void list_all_rooms_by_floor(char *viewpref);
 
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
 void display_edit_task(void);