Rewrote the code to check for "* %d RECENT". Still needs to be modified,
authorJeffrey Stedfast <fejj@helixcode.com>
Fri, 21 Jul 2000 19:30:20 +0000 (19:30 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Fri, 21 Jul 2000 19:30:20 +0000 (19:30 +0000)
2000-07-21  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/imap/camel-imap-store.c (camel_imap_command_extended): Rewrote
the code to check for "* %d RECENT". Still needs to be modified, but should
no longer cause an infinite loop by detecting mis-detecting RECENT messages.

camel/ChangeLog
camel/providers/imap/camel-imap-store.c

index ea8faf7..74b3ce3 100644 (file)
@@ -1,3 +1,9 @@
+2000-07-21  Jeffrey Stedfast  <fejj@helixcode.com>
+
+       * providers/imap/camel-imap-store.c (camel_imap_command_extended): Rewrote
+       the code to check for "* %d RECENT". Still needs to be modified, but should
+       no longer cause an infinite loop by detecting mis-detecting RECENT messages.
+
 2000-07-20  Jeffrey Stedfast  <fejj@helixcode.com>
 
        * providers/imap/camel-imap-folder.c (imap_get_summary): 
index f20cbfc..0844900 100644 (file)
@@ -800,13 +800,17 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
                g_ptr_array_add (data, respbuf);
                len += strlen (respbuf) + 1;
 
-               if (folder && *respbuf == '*' && (ptr = e_strstrcase (respbuf, "RECENT"))) {
-                       char *rcnt;
-
-                       for (rcnt = respbuf; rcnt < ptr && (*rcnt < '0' || *rcnt > '9'); rcnt++);
-
-                       if (rcnt < ptr)
-                               recent = atoi (rcnt);
+               if (*respbuf == '*' && (ptr = strstr (respbuf, "RECENT"))) {
+                       char *rcnt, *ercnt;
+
+                       d(fprintf (stderr, "*** We found a 'RECENT' flag: %s", respbuf));
+                       /* Make sure it's in the form: "* %d RECENT" */
+                       rcnt = respbuf + 2;
+                       if (*rcnt > '0' || *rcnt < '9') {
+                               for (ercnt = rcnt; ercnt < ptr && *ercnt != ' '; ercnt++);
+                               if (ercnt + 1 == ptr)
+                                       recent = atoi (rcnt);
+                       }
                }
        }