From bf2c78d1b720fff381b2a5a86bb154cffc0d7814 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 11 Sep 2018 14:41:51 +0200 Subject: Fix presence subscription notification displaying --- main/src/ui/conversation_summary/conversation_view.vala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main') diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala index e6a564de..9a3e5902 100644 --- a/main/src/ui/conversation_summary/conversation_view.vala +++ b/main/src/ui/conversation_summary/conversation_view.vala @@ -132,14 +132,20 @@ public class ConversationView : Box, Plugins.ConversationItemCollection { } private void initialize_for_conversation_(Conversation? conversation) { + // Deinitialize old conversation Dino.Application app = Dino.Application.get_default(); if (this.conversation != null) { foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_addition_populators) { populator.close(conversation); } } + + // Clear data structures + clear_notifications(); this.conversation = conversation; + + // Init for new conversation foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_addition_populators) { populator.init(conversation, this, Plugins.WidgetType.GTK); } @@ -378,6 +384,9 @@ public class ConversationView : Box, Plugins.ConversationItemCollection { item_item_skeletons.clear(); widgets.clear(); main.@foreach((widget) => { widget.destroy(); }); + } + + private void clear_notifications() { notifications.@foreach((widget) => { widget.destroy(); }); notification_revealer.transition_duration = 0; notification_revealer.set_reveal_child(false); -- cgit v1.2.3-70-g09d2