Commit 9a3f34b8 9a3f34b8193c5e676e48219822a095cdcbe19be8 by Sergey Poznyakoff

(imap4d_select_status): Run imap4d_sync() to output EXISTS and RECENT untagged responses.

1 parent 8f1f2636
......@@ -62,8 +62,7 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
return util_finish (command, RESP_NO, "Couldn't open mailbox");
if ((status = mailbox_create (&mbox, mailbox_name)) == 0
&& (status = mailbox_open (mbox, flags)) == 0
)
&& (status = mailbox_open (mbox, flags)) == 0)
{
select_flags = flags;
state = STATE_SEL;
......@@ -95,17 +94,15 @@ imap4d_select_status ()
if (state != STATE_SEL)
return 0; /* FIXME: this should be something! */
if (
(status = mailbox_uidvalidity (mbox, &uidvalidity)) ||
(status = mailbox_uidnext (mbox, &uidnext)) ||
(status = mailbox_messages_count (mbox, &count)) ||
(status = mailbox_messages_recent (mbox, &recent)) ||
(status = mailbox_message_unseen (mbox, &unseen))
)
if ((status = mailbox_uidvalidity (mbox, &uidvalidity))
|| (status = mailbox_uidnext (mbox, &uidnext))
|| (status = mailbox_messages_count (mbox, &count))
|| (status = mailbox_messages_recent (mbox, &recent))
|| (status = mailbox_message_unseen (mbox, &unseen)))
return status;
util_out (RESP_NONE, "%d EXISTS", count);
util_out (RESP_NONE, "%d RECENT", recent);
/* This outputs EXISTS and RECENT responses */
imap4d_sync();
util_out (RESP_OK, "[UIDVALIDITY %d] UID valididy status", uidvalidity);
util_out (RESP_OK, "[UIDNEXT %d] Predicted next uid", uidnext);
if (unseen)
......