# include "config.h"
#endif
+#include <lib-lib/macros.h>
+
+#include <lib-ui/curses.h>
+#include <lib-ui/menu.h>
+
#include "mutt.h"
-#include "mutt_curses.h"
-#include "mutt_menu.h"
#include "sort.h"
#include "mx.h"
#include "sidebar.h"
-#ifdef USE_IMAP
-#include "imap_private.h"
-#endif
+#include <imap/imap_private.h>
-#include "lib/intl.h"
void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx)
{
int changed = h->changed;
int deleted = ctx->deleted;
int tagged = ctx->tagged;
+ int flagged = ctx->flagged;
if (ctx->readonly && flag != M_TAG)
return; /* don't modify anything if we are read-only */
h->deleted = 1;
if (upd_ctx)
ctx->deleted++;
-#ifdef USE_IMAP
/* deleted messages aren't treated as changed elsewhere so that the
* purge-on-sync option works correctly. This isn't applicable here */
if (ctx && ctx->magic == M_IMAP) {
if (upd_ctx)
ctx->changed = 1;
}
-#endif
}
}
else if (h->deleted) {
ctx->appended--;
}
h->appended = 0; /* when undeleting, also reset the appended flag */
-#ifdef USE_IMAP
/* see my comment above */
if (ctx->magic == M_IMAP) {
h->changed = 1;
if (upd_ctx)
ctx->changed = 1;
}
-#endif
/*
* If the user undeletes a message which is marked as
* "trash" in the maildir folder on disk, the folder has
* search results so that any future search will match the current status
* of this message and not what it was at the time it was last searched.
*/
- if (h->searched
- && (changed != h->changed || deleted != ctx->deleted
- || tagged != ctx->tagged))
+ if (h->searched && (changed != h->changed || deleted != ctx->deleted ||
+ tagged != ctx->tagged || flagged != ctx->flagged))
h->searched = 0;
sidebar_draw (0);
}
if ((cur = cur->child) == NULL)
return (0);
- FOREVER {
+ for (;;) {
if (cur->message)
mutt_set_flag (Context, cur->message, flag, bf);