/* imap_status: returns count of messages in mailbox, or -1 on error.
* if queue != 0, queue the command and expect it to have been run
* on the next call (for pipelining the postponed count) */
-int imap_status (char* path, int queue)
+int imap_status (const char* path, int queue)
{
static int queued = 0;
int imap_sync_mailbox (CONTEXT *ctx, int expunge, int *index_hint);
int imap_close_mailbox (CONTEXT *ctx);
int imap_buffy_check (int force, int check_stats);
-int imap_status (char *path, int queue);
+int imap_status (const char *path, int queue);
int imap_search (CONTEXT* ctx, const pattern_t* pat);
int imap_subscribe (char *path, int subscribe);
int imap_complete (char* dest, size_t dlen, char* path);
{
if (flags & MUTT_BUFFY)
{
+#ifdef USE_IMAP
+ int passive = option (OPTIMAPPASSIVE);
+ if (passive)
+ unset_option (OPTIMAPPASSIVE);
+#endif
if (!mutt_buffy_check (0))
{
mutt_endwin _("No mailbox with new mail.");
}
folder[0] = 0;
mutt_buffy (folder, sizeof (folder));
+#ifdef USE_IMAP
+ if (passive)
+ set_option (OPTIMAPPASSIVE);
+#endif
}
else if (flags & MUTT_SELECT)
{
return mh_check_empty (path);
case MUTT_MAILDIR:
return maildir_check_empty (path);
+#ifdef USE_IMAP
+ case MUTT_IMAP:
+ {
+ int passive, rv;
+
+ passive = option (OPTIMAPPASSIVE);
+ if (passive)
+ unset_option (OPTIMAPPASSIVE);
+ rv = imap_status (path, 0);
+ if (passive)
+ set_option (OPTIMAPPASSIVE);
+ return (rv <= 0);
+ }
+#endif
default:
errno = EINVAL;
return -1;