diff options
author | fiaxh <git@mx.ax.lt> | 2018-03-07 20:41:08 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-03-10 20:01:22 +0100 |
commit | c8f68678be021d52a1fbc4efeba890b203123ef1 (patch) | |
tree | 67669e79d458ed35166ff839f38674dc21c14d32 /libdino/src/service/muc_manager.vala | |
parent | 81310dff2e712cf7ddbce7c4717cd5a77170c79a (diff) | |
download | dino-c8f68678be021d52a1fbc4efeba890b203123ef1.tar.gz dino-c8f68678be021d52a1fbc4efeba890b203123ef1.zip |
Recognize own MUC messages from other device
Diffstat (limited to 'libdino/src/service/muc_manager.vala')
-rw-r--r-- | libdino/src/service/muc_manager.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 60dc0446..8b5b8e7f 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -347,15 +347,19 @@ public class MucManager : StreamInteractionModule, Object { message.real_jid = real_jid.bare_jid; } } - string? muc_nick = stream.get_flag(Xep.Muc.Flag.IDENTITY).get_muc_nick(conversation.counterpart.bare_jid); - if (muc_nick != null && message.from.equals(new Jid(@"$(message.from.bare_jid)/$muc_nick"))) { // TODO better from own + 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)) { Gee.List<Entities.Message> messages = stream_interactor.get_module(MessageStorage.IDENTITY).get_messages(conversation); foreach (Entities.Message m in messages) { // TODO not here if (m.equals(message)) { - m.marked = Entities.Message.Marked.RECEIVED; + // For own messages from this device (msg is a duplicate) + m.marked = Message.Marked.RECEIVED; } } } + // For own messages from other devices (msg is not a duplicate msg) + message.marked = Message.Marked.RECEIVED; + return false; } } |