aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/counterpart_interaction_manager.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-07-06 19:32:16 +0200
committerfiaxh <git@lightrise.org>2020-07-22 18:36:04 +0200
commitb104be4842c4f5c309055052bd7b9d2fc9337113 (patch)
tree4ce6329e9d058a91624f1b2a4cf78d67262bf38c /libdino/src/service/counterpart_interaction_manager.vala
parentc887240fdcdbc8f76c6bdd37b1174b8154907c4c (diff)
downloaddino-b104be4842c4f5c309055052bd7b9d2fc9337113.tar.gz
dino-b104be4842c4f5c309055052bd7b9d2fc9337113.zip
Don't create a second message object for each typing notification
Diffstat (limited to 'libdino/src/service/counterpart_interaction_manager.vala')
-rw-r--r--libdino/src/service/counterpart_interaction_manager.vala6
1 files changed, 2 insertions, 4 deletions
diff --git a/libdino/src/service/counterpart_interaction_manager.vala b/libdino/src/service/counterpart_interaction_manager.vala
index 7a98f0ff..7776b885 100644
--- a/libdino/src/service/counterpart_interaction_manager.vala
+++ b/libdino/src/service/counterpart_interaction_manager.vala
@@ -95,8 +95,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
// Don't show our own (other devices) typing notification
if (jid.equals_bare(account.bare_jid)) return;
- Message message = yield stream_interactor.get_module(MessageProcessor.IDENTITY).parse_message_stanza(account, stanza);
- Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_for_message(message);
+ Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).approx_conversation_for_stanza(jid, account, stanza.type_);
if (conversation == null) return;
// Don't show our own typing notification in MUCs
@@ -119,8 +118,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
}
private async void on_chat_marker_received(Account account, Jid jid, string marker, string stanza_id, MessageStanza message_stanza) {
- Message message = yield stream_interactor.get_module(MessageProcessor.IDENTITY).parse_message_stanza(account, message_stanza);
- Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_for_message(message);
+ Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).approx_conversation_for_stanza(jid, account, message_stanza.type_);
if (conversation == null) return;
handle_chat_marker(conversation, jid, marker, stanza_id);
}