+ if (header)
+ g_object_unref (header);
+
+ if (folder) {
+ /* Trick: do a poke status in order to speed up the signaling
+ of observers.
+ A delete via the menu does this, in do_headers_action(),
+ but it does not seem to solve the stricken-out-but-not-removed problem here.
+ */
+ tny_folder_poke_status (folder);
+
+ g_object_unref (folder);
+ }
+
+ if (account) {
+ /* Do a refresh so that stricken-out emails are really removed from the treeview.
+ * TODO: Why is this necessary here, but not when doing a delete from the menu or toolbar? */
+ const gchar *modest_account_name =
+ modest_tny_account_get_parent_modest_account_name_for_server_account (account);
+ modest_ui_actions_do_send_receive (modest_account_name, MODEST_WINDOW (win));
+
+ g_object_unref (account);
+ }
+