summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dbmail-imapsession.c6
-rw-r--r--src/imapcommands.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/dbmail-imapsession.c b/src/dbmail-imapsession.c
index d0c51d2c..4de9ac23 100644
--- a/src/dbmail-imapsession.c
+++ b/src/dbmail-imapsession.c
@@ -1438,8 +1438,8 @@ int dbmail_imap_session_mailbox_status(ImapSession * self, gboolean update)
char *oldflags, *newflags;
M = self->mailbox->mbstate;
- oldflags = MailboxState_flags(M);
oldseq = MailboxState_getSeq(M);
+ oldflags = MailboxState_flags(M);
oldexists = MailboxState_getExists(M);
oldrecent = MailboxState_getRecent(M);
olduidnext = MailboxState_getUidnext(M);
@@ -1472,8 +1472,10 @@ int dbmail_imap_session_mailbox_status(ImapSession * self, gboolean update)
// command specific overrides
switch (self->command_type) {
- case IMAP_COMM_SELECT:
case IMAP_COMM_EXAMINE:
+ case IMAP_COMM_SELECT:
+ case IMAP_COMM_SEARCH:
+ case IMAP_COMM_SORT:
showexists = showrecent = TRUE;
break;
diff --git a/src/imapcommands.c b/src/imapcommands.c
index f6c0f6a8..140a7770 100644
--- a/src/imapcommands.c
+++ b/src/imapcommands.c
@@ -1426,6 +1426,9 @@ static void sorted_search_enter(dm_thread_data *D)
SESSION_RETURN;
}
+ if (self->state == CLIENTSTATE_SELECTED)
+ dbmail_imap_session_mailbox_status(self, TRUE);
+
mb = self->mailbox;
switch(order) {
case SEARCH_SORTED: