2007-04-03 [colin] 2.8.1cvs87
authorColin Leroy <colin@colino.net>
Tue, 3 Apr 2007 20:34:07 +0000 (20:34 +0000)
committerColin Leroy <colin@colino.net>
Tue, 3 Apr 2007 20:34:07 +0000 (20:34 +0000)
* src/imap.c
Fix crash with Citadel, and try to make
things work. this server (and specifically
STATUS and APPEND at least) seems broken.

ChangeLog
PATCHSETS
configure.ac
src/imap.c

index 4f3adda..ed1d460 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-03 [colin]     2.8.1cvs87
+
+       * src/imap.c
+               Fix crash with Citadel, and try to make
+               things work. this server (and specifically 
+               STATUS and APPEND at least) seems broken.
+
 2007-04-03 [colin]     2.8.1cvs86
 
        * src/folderview.c
index 1aca653..e40ebc7 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.30 -r 1.60.2.31 src/filtering.c;  cvs diff -u -r 1.213.2.138 -r 1.213.2.139 src/folder.c;  cvs diff -u -r 1.87.2.39 -r 1.87.2.40 src/folder.h;  cvs diff -u -r 1.204.2.129 -r 1.204.2.130 src/prefs_common.c;  cvs diff -u -r 1.103.2.79 -r 1.103.2.80 src/prefs_common.h;  cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/prefs_other.c;  ) > 2.8.1cvs84.patchset
 ( cvs diff -u -r 1.213.2.139 -r 1.213.2.140 src/folder.c;  cvs diff -u -r 1.179.2.163 -r 1.179.2.164 src/imap.c;  cvs diff -u -r 1.34.2.13 -r 1.34.2.14 src/imap.h;  cvs diff -u -r 1.1.2.44 -r 1.1.2.45 src/imap_gtk.c;  cvs diff -u -r 1.149.2.71 -r 1.149.2.72 src/inc.c;  cvs diff -u -r 1.1.4.76 -r 1.1.4.77 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.2.64 -r 1.1.2.65 src/gtk/quicksearch.c;  ) > 2.8.1cvs85.patchset
 ( cvs diff -u -r 1.207.2.159 -r 1.207.2.160 src/folderview.c;  ) > 2.8.1cvs86.patchset
+( cvs diff -u -r 1.179.2.164 -r 1.179.2.165 src/imap.c;  ) > 2.8.1cvs87.patchset
index 8f3b5fc..7c9615d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=86
+EXTRA_VERSION=87
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b51447b..04153a9 100644 (file)
@@ -2665,15 +2665,19 @@ static gint imap_status(IMAPSession *session, IMAPFolder *folder,
 
        if (messages) {
                mask |= 1 << 0;
+               *messages = 0;
        }
        if (uid_next) {
                mask |= 1 << 2;
+               *uid_next = 0;
        }
        if (uid_validity) {
                mask |= 1 << 3;
+               *uid_validity = 0;
        }
        if (unseen) {
                mask |= 1 << 4;
+               *unseen = 0;
        }
        r = imap_threaded_status(FOLDER(folder), real_path, 
                &data_status, mask);
@@ -2698,31 +2702,38 @@ static gint imap_status(IMAPSession *session, IMAPFolder *folder,
                info = clist_content(iter);
                switch (info->st_att) {
                case MAILIMAP_STATUS_ATT_MESSAGES:
-                       * messages = info->st_value;
-                       got_values |= 1 << 0;
+                       if (messages) {
+                               * messages = info->st_value;
+                               got_values |= 1 << 0;
+                       }
                        break;
                        
                case MAILIMAP_STATUS_ATT_UIDNEXT:
-                       * uid_next = info->st_value;
-                       got_values |= 1 << 2;
+                       if (uid_next) {
+                               * uid_next = info->st_value;
+                               got_values |= 1 << 2;
+                       }
                        break;
                        
                case MAILIMAP_STATUS_ATT_UIDVALIDITY:
-                       * uid_validity = info->st_value;
-                       got_values |= 1 << 3;
+                       if (uid_validity) {
+                               * uid_validity = info->st_value;
+                               got_values |= 1 << 3;
+                       }
                        break;
                        
                case MAILIMAP_STATUS_ATT_UNSEEN:
-                       * unseen = info->st_value;
-                       got_values |= 1 << 4;
+                       if (unseen) {
+                               * unseen = info->st_value;
+                               got_values |= 1 << 4;
+                       }
                        break;
                }
        }
        mailimap_mailbox_data_status_free(data_status);
        
        if (got_values != mask) {
-               debug_print("status: incomplete values received (%d)\n", got_values);
-               return IMAP_ERROR;
+               g_warning("status: incomplete values received (%d)\n", got_values);
        }
        return IMAP_SUCCESS;
 }