OP_VIEW_ATTACH "view attachment using mailcap entry if necessary"
OP_VIEW_ATTACHMENTS "show MIME attachments"
OP_WHAT_KEY "display the keycode for a key press"
+OP_CHECK_STATS "calculate message statistics for all mailboxes"
OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread"
OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads"
}
/* Check all Incoming for new mail and total/new/flagged messages
- * force: if true, ignore BuffyTimeout and check for new mail anyway
+ * The force argument may be any combination of the following values:
+ * MUTT_BUFFY_CHECK_FORCE ignore BuffyTimeout and check for new mail
+ * MUTT_BUFFY_CHECK_FORCE_STATS ignore BuffyTimeout and calculate statistics
*/
int mutt_buffy_check (int force)
{
#ifdef USE_IMAP
/* update postponed count as well, on force */
- if (force)
+ if (force & MUTT_BUFFY_CHECK_FORCE)
mutt_update_num_postponed ();
#endif
if (!force && (t - BuffyTime < BuffyTimeout))
return BuffyCount;
- if (option (OPTMAILCHECKSTATS) &&
- (t - BuffyStatsTime >= BuffyCheckStatsInterval))
+ if ((force & MUTT_BUFFY_CHECK_FORCE_STATS) ||
+ (option (OPTMAILCHECKSTATS) &&
+ (t - BuffyStatsTime >= BuffyCheckStatsInterval)))
{
check_stats = 1;
BuffyStatsTime = t;
found = 1;
}
- mutt_buffy_check (1); /* buffy was wrong - resync things */
+ mutt_buffy_check (MUTT_BUFFY_CHECK_FORCE); /* buffy was wrong - resync
+ things */
}
/* no folders with new mail */
int mh_buffy (BUFFY *, int);
+/* force flags passed to mutt_buffy_check() */
+#define MUTT_BUFFY_CHECK_FORCE 1
+#define MUTT_BUFFY_CHECK_FORCE_STATS (1<<1)
+
#endif /* _BUFFY_H */
return rv;
}
-
+void mutt_check_stats (void)
+{
+ mutt_buffy_check (MUTT_BUFFY_CHECK_FORCE | MUTT_BUFFY_CHECK_FORCE_STATS);
+}
menu->custom_menu_redraw = index_menu_redraw;
mutt_push_current_menu (menu);
- if (!attach_msg)
- mutt_buffy_check(1); /* force the buffy check after we enter the folder */
+ if (!attach_msg) {
+ mutt_buffy_check(MUTT_BUFFY_CHECK_FORCE); /* force the buffy check after we
+ enter the folder */
+ }
#ifdef USE_INOTIFY
mutt_monitor_add (NULL);
#endif
#endif
mutt_clear_error ();
- mutt_buffy_check(1); /* force the buffy check after we have changed
- the folder */
+ mutt_buffy_check(MUTT_BUFFY_CHECK_FORCE); /* force the buffy check after
+ we have changed the
+ folder */
menu->redraw = REDRAW_FULL;
set_option (OPTSEARCHINVALID);
break;
mutt_what_key();
break;
+ case OP_CHECK_STATS:
+ mutt_check_stats();
+ break;
+
#ifdef USE_SIDEBAR
case OP_SIDEBAR_NEXT:
case OP_SIDEBAR_NEXT_NEW:
<variablelist>
+<varlistentry>
+<term>
+<literal><check-stats></literal><anchor id="check-stats"/>
+</term>
+<listitem>
+<para>
+Calculate statistics for all monitored mailboxes declared using the
+<command>mailboxes</command> command.
+It will calculate statistics despite
+<link linkend="mail-check-stats">$mail_check_stats</link> being unset.
+</para>
+</listitem>
+</varlistentry>
+
<varlistentry>
<term>
<literal><create-alias></literal><anchor id="create-alias"/>
{ "current-bottom", OP_CURRENT_BOTTOM, NULL },
{ "error-history", OP_ERROR_HISTORY, NULL },
{ "what-key", OP_WHAT_KEY, NULL },
+ { "check-stats", OP_CHECK_STATS, NULL },
{ NULL, 0, NULL }
};
{ "decrypt-save", OP_DECRYPT_SAVE, NULL },
{ "what-key", OP_WHAT_KEY, NULL },
+ { "check-stats", OP_CHECK_STATS, NULL },
#ifdef USE_SIDEBAR
{ "sidebar-next", OP_SIDEBAR_NEXT, NULL },
** this operation is more performance intensive, it defaults to
** \fIunset\fP, and has a separate option, $$mail_check_stats_interval, to
** control how often to update these counts.
+ ** .pp
+ ** Message statistics can also be explicitly calculated by invoking the
+ ** \fC<check-stats>\fP
+ ** function.
*/
{ "mail_check_stats_interval", DT_NUM, R_NONE, UL &BuffyCheckStatsInterval, 60 },
/*
mutt_what_key ();
break;
+ case OP_CHECK_STATS:
+ mutt_check_stats ();
+ break;
+
case OP_REDRAW:
clearok (stdscr, TRUE);
menu->redraw = REDRAW_FULL;
mutt_what_key ();
break;
+ case OP_CHECK_STATS:
+ mutt_check_stats ();
+ break;
+
#ifdef USE_SIDEBAR
case OP_SIDEBAR_NEXT:
case OP_SIDEBAR_NEXT_NEW:
void mutt_buffy (char *, size_t);
int mutt_buffy_list (void);
void mutt_canonical_charset (char *, size_t, const char *);
+void mutt_check_stats(void);
int mutt_count_body_parts (CONTEXT *, HEADER *);
void mutt_check_rescore (CONTEXT *);
void mutt_clear_error (void);