]> granicus.if.org Git - neomutt/commitdiff
imap_expunge_mailbox: use mailbox notifications
authorRichard Russon <rich@flatcap.org>
Sun, 23 Dec 2018 00:11:20 +0000 (00:11 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 5 Jan 2019 14:44:35 +0000 (14:44 +0000)
imap/imap.c

index b932810ee3c809f35f29af45043138e260f1edcc..58e3ff40e4a485b15c8e73ad8d35f9113f6cffc6 100644 (file)
@@ -784,16 +784,11 @@ void imap_expunge_mailbox(struct Mailbox *m)
     return;
 
   struct Email *e = NULL;
-  short old_sort;
 
 #ifdef USE_HCACHE
   mdata->hcache = imap_hcache_open(adata, mdata);
 #endif
 
-  old_sort = Sort;
-  Sort = SORT_ORDER;
-  mutt_sort_headers(mdata->ctx, false);
-
   for (int i = 0; i < m->msg_count; i++)
   {
     e = m->emails[i];
@@ -841,11 +836,7 @@ void imap_expunge_mailbox(struct Mailbox *m)
   imap_hcache_close(mdata);
 #endif
 
-  /* We may be called on to expunge at any time. We can't rely on the caller
-   * to always know to rethread */
-  mx_update_tables(mdata->ctx, false);
-  Sort = old_sort;
-  mutt_sort_headers(mdata->ctx, true);
+  mutt_mailbox_changed(m, MBN_RESORT);
 }
 
 /**