* fix hickup with the floordiv_expanded setting; the way its now it shouldn't double...
authorWilfried Göesgens <willi@citadel.org>
Mon, 25 Aug 2008 22:06:50 +0000 (22:06 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 25 Aug 2008 22:06:50 +0000 (22:06 +0000)
webcit/auth.c
webcit/roomops.c
webcit/webcit.h

index ff1350be14c43bc1f53c60d497a69324a9013064..5b92c99bf458f7f249675da70ff43967dd0f5f82 100644 (file)
@@ -209,6 +209,7 @@ void display_openid_name_request(char *claimed_id, char *username) {
 void become_logged_in(char *user, char *pass, char *serv_response)
 {
        char buf[SIZ];
+       StrBuf *FloorDiv;
 
        WC->logged_in = 1;
        extract_token(WC->wc_fullname, &serv_response[4], 0, '|', sizeof WC->wc_fullname);
@@ -232,7 +233,8 @@ void become_logged_in(char *user, char *pass, char *serv_response)
 
        get_pref_long("current_iconbar", &WC->current_iconbar, current_iconbar_menu);
 
-       get_preference("floordiv_expanded", &WC->floordiv_expanded);
+       get_preference("floordiv_expanded", &FloorDiv);
+       WC->floordiv_expanded = FloorDiv;
 }
 
 
@@ -553,7 +555,6 @@ void end_webcit_session(void) {
        
        if (WC->logged_in) {
                set_pref_long("current_iconbar", WC->current_iconbar, 0);
-               set_preference("floordiv_expanded", WC->floordiv_expanded, 1);
        }
 
        serv_puts("QUIT");
index 7014040f17c02edf88e349619b798bae1fc4f82a..05a0ec4a2c00478631677f121e0f3fd08cb6adcd 100644 (file)
@@ -3190,11 +3190,9 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
 void set_floordiv_expanded(void) {
        struct wcsession *WCC = WC;
        
-       if (WCC->floordiv_expanded == NULL)
-               WCC->floordiv_expanded = NewStrBuf();
-       else
-               FlushStrBuf(WC->floordiv_expanded);
-       StrBufAppendBuf(WC->floordiv_expanded, WC->UrlFragment1, 0);
+       WCC->floordiv_expanded = NewStrBuf();
+       StrBufAppendBuf(WCC->floordiv_expanded, WCC->UrlFragment1, 0);
+       set_preference("floordiv_expanded", WCC->floordiv_expanded, 1);
 }
 
 /**
index 41485b8e872c2a7d71603652754e85dc8246cd62..2db42708fe08861d7628970253cad69d325b70bf 100644 (file)
@@ -476,7 +476,7 @@ struct wcsession {
        time_t cache_timestamp;                 /**< ??? todo */
        HashList *IconBarSetttings;             /**< which icons should be shown / not shown? */
        long current_iconbar;                   /**< What is currently in the iconbar? */
-       StrBuf *floordiv_expanded;              /**< which floordiv currently expanded */
+       const StrBuf *floordiv_expanded;        /**< which floordiv currently expanded */
        int selected_language;                  /**< Language selected by user */
        time_t last_pager_check;                /**< last time we polled for instant msgs */
        int nonce;                              /**< session nonce (to prevent session riding) */