tmp->msg_unread = 0;
tmp->msg_flagged = 0;
nm_nonctx_get_count(tmp->path, &tmp->msg_count, &tmp->msg_unread);
- if (tmp->msg_unread > 0)
+ if (tmp->msg_unread > 0) {
BuffyCount++;
+ tmp->new = 1;
+ }
+ sb_set_update_time();
break;
#endif
}
*s = '\0';
}
+#ifdef USE_NOTMUCH
+void mutt_buffy_vfolder (char *s, size_t slen)
+{
+ BUFFY *tmp;
+ int pass, found = 0;
+
+ if (mutt_buffy_check (0))
+ {
+ for (pass = 0; pass < 2; pass++) {
+ for (tmp = VirtIncoming; tmp; tmp = tmp->next)
+ {
+ if ((found || pass) && tmp->new)
+ {
+ strfcpy (s, tmp->desc, slen);
+ return;
+ }
+ if (mutt_strcmp (s, tmp->path) == 0)
+ found = 1;
+ }
+ }
+
+ mutt_buffy_check (1); /* buffy was wrong - resync things */
+ }
+
+ /* no folders with new mail */
+ *s = '\0';
+}
+#endif
+
/* fetch buffy object for given path, if present */
static BUFFY* buffy_get (const char *path)
{
#ifdef USE_NOTMUCH
WHERE BUFFY *VirtIncoming INITVAL (0);
+void mutt_buffy_vfolder (char *s, size_t slen);
#endif
extern time_t BuffyDoneTime; /* last time we knew for sure how much mail there was */
}
#ifdef USE_NOTMUCH
else if (op == OP_MAIN_CHANGE_VFOLDER) {
+ if (Context->magic == M_NOTMUCH) {
+ strfcpy(buf, Context->path, sizeof (buf));
+ mutt_buffy_vfolder (buf, sizeof (buf));
+ }
mutt_enter_vfolder (cp, buf, sizeof (buf), &menu->redraw, 1);
if (!buf[0])
{