[geary: 4/13] Conversation should be removed after flags_changed if conversation no longer contains any messages.



commit 69877b32091129385a7536c69804825faa7d95ba
Author: James Magahern <james magahern com>
Date:   Tue Oct 9 23:35:19 2018 -0700

    Conversation should be removed after flags_changed if conversation no longer contains any messages.

 src/client/conversation-list/conversation-list-store.vala | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/client/conversation-list/conversation-list-store.vala 
b/src/client/conversation-list/conversation-list-store.vala
index 7b82381a..125c0526 100644
--- a/src/client/conversation-list/conversation-list-store.vala
+++ b/src/client/conversation-list/conversation-list-store.vala
@@ -463,6 +463,12 @@ public class ConversationListStore : Gtk.ListStore {
     
     private void on_email_flags_changed(Geary.App.Conversation conversation) {
         refresh_flags(conversation);
+
+        // Remove conversation if get_emails yields an empty collection -- this probably means
+        // the conversation was deleted. 
+        if (conversation.get_emails(Geary.App.Conversation.Ordering.NONE).size == 0) {
+            remove_conversation(conversation);
+        }
         
         // refresh previews because the oldest unread message is displayed as the preview, and if
         // that's changed, need to change the preview


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]