Commit c7376cec c7376cec212fc20f39388a216f29661975b109cf by Sergey Poznyakoff

imap4d: don't issue spurious unsolicited responses after EXPUNGE.

* imap4d/expunge.c (imap4d_expunge): Clear attribute table before
resynching.
* imap4d/imap4d.h (imap4d_sync_invalidate): New extern.
* imap4d/sync.c (invalidate_attr_table): Rename to imap4d_sync_invalidate;
make extern. All callers updated.
1 parent 523bea73
......@@ -39,6 +39,7 @@ imap4d_expunge (struct imap4d_command *command, imap4d_tokbuf_t tok)
/* FIXME: check for errors. */
mu_mailbox_expunge (mbox);
imap4d_sync_invalidate ();
imap4d_sync ();
return io_completion_response (command, RESP_OK, "Completed");
}
......
......@@ -324,6 +324,7 @@ int make_interdir (const char *name, int delim, int perms);
/* Synchronisation on simultaneous access. */
extern int imap4d_sync (void);
extern void imap4d_sync_invalidate (void);
extern int imap4d_sync_flags (size_t);
extern size_t uid_to_msgno (size_t);
extern void imap4d_set_observer (mu_mailbox_t mbox);
......
......@@ -39,8 +39,8 @@ realloc_attributes (size_t total)
attr_table_count = total;
}
static void
invalidate_attr_table ()
void
imap4d_sync_invalidate ()
{
attr_table_valid = 0;
attr_table_count = 0;
......@@ -191,7 +191,7 @@ imap4d_sync (void)
It may be because of close or before select/examine a new mailbox.
If it was a close we do not send any notification. */
if (mbox == NULL)
invalidate_attr_table ();
imap4d_sync_invalidate ();
else if (!attr_table_valid || !mu_mailbox_is_updated (mbox))
{
if (mailbox_corrupt)
......@@ -205,7 +205,7 @@ imap4d_sync (void)
if (status)
imap4d_bye (ERR_MAILBOX_CORRUPTED);
imap4d_set_observer (mbox);
invalidate_attr_table ();
imap4d_sync_invalidate ();
mailbox_corrupt = 0;
io_untagged_response (RESP_NONE,
"OK [ALERT] Mailbox modified by another program");
......