aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/conversation_manager.vala2
-rw-r--r--libdino/src/service/muc_manager.vala5
2 files changed, 7 insertions, 0 deletions
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) {