]> granicus.if.org Git - neomutt/commitdiff
Fix at least Kyle Wheeler's new mail detection problems: call imap_fix_path
authorBrendan Cully <brendan@kublai.com>
Thu, 22 Dec 2005 20:14:04 +0000 (20:14 +0000)
committerBrendan Cully <brendan@kublai.com>
Thu, 22 Dec 2005 20:14:04 +0000 (20:14 +0000)
on buffy path.

imap/command.c

index d4369240d24ee961058caf87b9688158ffe70ca7..6f78e937a8190445011ba9cb75c43244d89a1711 100644 (file)
@@ -824,27 +824,35 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s)
       dprint (1, (debugfile, "Error parsing mailbox %s, skipping\n", inc->path));
       continue;
     }
+    /* dprint (2, (debugfile, "Buffy entry: [%s] mbox: [%s]\n", inc->path, NONULL(mx.mbox))); */
     
-    if (mutt_account_match (&idata->conn->account, &mx.account) && mx.mbox
-        && imap_mxcmp (mailbox, mx.mbox) == 0)
+    if (mutt_account_match (&idata->conn->account, &mx.account))
     {
-      dprint (2, (debugfile, "Found %s in buffy list (OV: %d ON: %d U: %d)\n",
-                  mailbox, olduv, oldun, status->unseen));
+      value = safe_strdup (mx.mbox);
+      imap_fix_path (idata, mx.mbox, value, mutt_strlen (value) + 1);
+      FREE (&mx.mbox);
 
-      if (olduv && olduv == status->uidvalidity)
+      if (value && !imap_mxcmp (mailbox, value))
       {
-        if (oldun < status->uidnext)
+        dprint (2, (debugfile, "Found %s in buffy list (OV: %d ON: %d U: %d)\n",
+                    mailbox, olduv, oldun, status->unseen));
+        
+        if (olduv && olduv == status->uidvalidity)
         {
-          inc->new = status->unseen;
+          if (oldun < status->uidnext)
+          {
+            inc->new = status->unseen;
+          }
         }
-      }
-      else
-        inc->new = status->unseen;
-      /* forced back to keep detecting new mail until the mailbox is opened */
-      status->uidnext = oldun;
+        else
+          inc->new = status->unseen;
 
-      FREE (&mx.mbox);
-      return;
+        /* forced back to keep detecting new mail until the mailbox is opened */
+        status->uidnext = oldun;
+
+        FREE (&value);
+        return;
+      }
     }
 
     FREE (&mx.mbox);