Don't process message markers on MUC messages

This commit is contained in:
fiaxh 2020-01-27 17:32:02 +01:00
parent 3b0a27e14b
commit 143212b6c8
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
// If we received a display marker from ourselves (other device), set the conversation read up to that message.
if (marker != Xep.ChatMarkers.MARKER_DISPLAYED && marker != Xep.ChatMarkers.MARKER_ACKNOWLEDGED) return;
Conversation? conversation = stream_interactor.get_module(MessageStorage.IDENTITY).get_conversation_for_stanza_id(account, stanza_id);
if (conversation == null) return;
if (conversation == null || conversation.type_ == Conversation.Type.GROUPCHAT) return;
Entities.Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_stanza_id(stanza_id, conversation);
if (message == null) return;
// Don't move read marker backwards because we get old info from another client
@ -98,6 +98,10 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
} else {
// We received a marker from someone else. Search the respective message and mark it.
foreach (Conversation conversation in stream_interactor.get_module(ConversationManager.IDENTITY).get_conversations(jid, account)) {
// We can't currently handle chat markers in MUCs
if (conversation.type_ == Conversation.Type.GROUPCHAT) continue;
Entities.Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_stanza_id(stanza_id, conversation);
if (message != null) {
switch (marker) {