From 91b38dc2ae954dadfcbd179b512a212d4f29a6ff Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Thu, 22 Dec 2005 20:14:04 +0000 Subject: [PATCH] Fix at least Kyle Wheeler's new mail detection problems: call imap_fix_path on buffy path. --- imap/command.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/imap/command.c b/imap/command.c index d4369240d..6f78e937a 100644 --- a/imap/command.c +++ b/imap/command.c @@ -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); -- 2.40.0