#include <lib-ui/lib-ui.h>
#include <lib-ui/menu.h>
-#include <lib-ui/sidebar.h>
#include <lib-mx/mx.h>
+#include <imap/imap.h>
#include "mutt.h"
#include "sort.h"
-#include <imap/imap_private.h>
-
void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx)
{
if ((Sort & SORT_MASK) != SORT_THREADS) {
mutt_error _("Threading is not enabled.");
- return (-1);
+ return -1;
}
if (!subthread)
mutt_set_flag (Context, cur->message, flag, bf);
if ((cur = cur->child) == NULL)
- return (0);
+ return 0;
for (;;) {
if (cur->message)
while (!cur->next) {
cur = cur->parent;
if (cur == start)
- return (0);
+ return 0;
}
cur = cur->next;
}
int mutt_change_flag(HEADER * h, int bf)
{
+ char buf[STRING];
+ const char letters[] = "dDnNoOrR*!";
static char const actions[] = {
['d'] = M_DELETE, ['D'] = M_DELETE,
['n'] = M_NEW, ['N'] = M_NEW,
int c;
- mvwprintw(stdscr, LINES - 1, 0, "%s? (D/N/O/r/*/!): ",
+ snprintf(buf, sizeof(buf), "%s? (D/N/O/r/*/!): ",
bf ? _("Set flag") : _("Clear flag"));
- wclrtoeol(stdscr);
-
- c = mutt_getch().ch;
- if (c == -1) {
- CLEARLINE (LINES - 1);
- return (-1);
- }
-
- CLEARLINE (LINES - 1);
-
- if (c < 0 || c > countof(actions) || !actions[c]) {
- BEEP();
+ c = mutt_multi_choice(buf, letters);
+ if (c <= 0)
return -1;
- }
-
+ c = letters[c - 1];
if (actions[c] == M_OLD) {
if (h) {
mutt_set_flag(Context, h, M_READ, !bf);