From 7f21f898e0ec6efe5a8cf66053150e9a20ade53e Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 15 Jan 2020 23:44:15 +0100 Subject: Fix ConversationRow closing if animations are disabled --- libdino/src/service/conversation_manager.vala | 2 ++ libdino/src/service/muc_manager.vala | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'libdino/src/service') diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala index c473ea77..3b48f154 100644 --- a/libdino/src/service/conversation_manager.vala +++ b/libdino/src/service/conversation_manager.vala @@ -126,6 +126,8 @@ public class ConversationManager : StreamInteractionModule, Object { } public void close_conversation(Conversation conversation) { + if (!conversation.active) return; + conversation.active = false; conversation_deactivated(conversation); } diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 62d089e7..ab461701 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -33,6 +33,11 @@ public class MucManager : StreamInteractionModule, Object { stream_interactor.account_added.connect(on_account_added); stream_interactor.stream_negotiated.connect(on_stream_negotiated); stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(received_message_listener); + stream_interactor.get_module(ConversationManager.IDENTITY).conversation_deactivated.connect((conversation) => { + if (conversation.type_ == Conversation.Type.GROUPCHAT) { + part(conversation.account, conversation.counterpart); + } + }); } public async Muc.JoinResult? join(Account account, Jid jid, string? nick, string? password) { -- cgit v1.2.3-70-g09d2