From 86b101900c28a09ebc6bcbf212f9969f70ce51b7 Mon Sep 17 00:00:00 2001 From: eerielili Date: Sun, 8 Oct 2023 11:51:30 +0000 Subject: Start conversation if closed when receiving an audio or video call (#1485) * Start conversation if closed when receiving an audio or video call * Fix starting conversation on new calls, move setting conversation.last_active --------- Co-authored-by: fiaxh --- libdino/src/service/conversation_manager.vala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libdino/src/service/conversation_manager.vala') diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala index 59ccbac4..f966ccc7 100644 --- a/libdino/src/service/conversation_manager.vala +++ b/libdino/src/service/conversation_manager.vala @@ -29,6 +29,8 @@ public class ConversationManager : StreamInteractionModule, Object { stream_interactor.account_removed.connect(on_account_removed); stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(new MessageListener(stream_interactor)); stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(handle_sent_message); + stream_interactor.get_module(Calls.IDENTITY).call_incoming.connect(handle_new_call); + stream_interactor.get_module(Calls.IDENTITY).call_outgoing.connect(handle_new_call); } public Conversation create_conversation(Jid jid, Account account, Conversation.Type? type = null) { @@ -194,6 +196,11 @@ public class ConversationManager : StreamInteractionModule, Object { } } + private void handle_new_call(Call call, CallState state, Conversation conversation) { + conversation.last_active = call.time; + start_conversation(conversation); + } + private void add_conversation(Conversation conversation) { if (!conversations[conversation.account].has_key(conversation.counterpart)) { conversations[conversation.account][conversation.counterpart] = new ArrayList(Conversation.equals_func); -- cgit v1.2.3-70-g09d2