Fix received mark for own OMEMO encrypted MUC messages

This commit is contained in:
fiaxh 2019-03-16 01:13:40 +01:00
parent 6f6e4b97cb
commit 67dbfdd0b0

View file

@ -396,14 +396,12 @@ public class MucManager : StreamInteractionModule, Object {
} }
} }
Jid? own_muc_jid = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(message.counterpart.bare_jid, conversation.account); Jid? own_muc_jid = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(message.counterpart.bare_jid, conversation.account);
if (own_muc_jid != null && message.from.equals(own_muc_jid)) { if (stanza.id != null && own_muc_jid != null && message.from.equals(own_muc_jid)) {
Gee.List<Entities.Message> messages = stream_interactor.get_module(MessageStorage.IDENTITY).get_messages(conversation); Entities.Message? m = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_stanza_id(stanza.id, conversation);
foreach (Entities.Message m in messages) { // TODO not here if (m != null) {
if (m.equals(message)) {
// For own messages from this device (msg is a duplicate) // For own messages from this device (msg is a duplicate)
m.marked = Message.Marked.RECEIVED; m.marked = Message.Marked.RECEIVED;
} }
}
// For own messages from other devices (msg is not a duplicate msg) // For own messages from other devices (msg is not a duplicate msg)
message.marked = Message.Marked.RECEIVED; message.marked = Message.Marked.RECEIVED;
} }