X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fimap.c;h=a59eb4bcda6a0f110e1bb7dd41493567130d11a9;hb=7f378c807269de852f212a050c43a675a241f83b;hp=6ad04dfc953ebb97014c8a0cb6cdbbf6a8766776;hpb=692cf062e86570a73f9147e09f017ccec378be58;p=apps%2Fmadmutt.git diff --git a/imap/imap.c b/imap/imap.c index 6ad04df..a59eb4b 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1136,9 +1136,12 @@ int imap_check_mailbox (CONTEXT * ctx, int *index_hint, int force) return result; } -/* returns count of recent messages if new = 1, else count of total messages. - * (useful for at least postponed function) - * Question of taste: use RECENT or UNSEEN for new? +/* + * count messages: + * new == 1: recent + * new == 2: unseen + * otherwise: total + * return: * 0+ number of messages in mailbox * -1 error while polling mailboxes */ @@ -1186,7 +1189,7 @@ int imap_mailbox_check (char *path, int new) else if (mutt_bit_isset (idata->capabilities, IMAP4REV1) || mutt_bit_isset (idata->capabilities, STATUS)) { snprintf (buf, sizeof (buf), "STATUS %s (%s)", mbox, - new ? "RECENT" : "MESSAGES"); + new == 1 ? "RECENT" : (new == 2 ? "UNSEEN" : "MESSAGES")); } else /* Server does not support STATUS, and this is not the current mailbox. @@ -1441,7 +1444,7 @@ int imap_subscribe (char *path, int subscribe) BUFFER err, token; IMAP_MBOX mx; - if (mx_get_magic (path) != M_IMAP || imap_parse_path (path, &mx) < 0) { + if (mx_get_magic (path) == M_IMAP || imap_parse_path (path, &mx)) { mutt_error (_("Bad mailbox name")); return -1; }