diff options
author | Andreas Straub <andy@strb.org> | 2015-07-29 16:41:58 +0200 |
---|---|---|
committer | Andreas Straub <andy@strb.org> | 2015-07-29 16:41:58 +0200 |
commit | e6df4d81d23e4b7c0c3798f114714dd3caebfe8c (patch) | |
tree | 5104a74ceac0fb9782ed40cbe89cccb4d6b8b0e9 /src/main/java/eu/siacs/conversations/parser | |
parent | e10a6c5b87d5d4b4871fdf31bbc9a7ef8b8d6ff1 (diff) |
Tag carbon messages in parser, adapt session logic
Messages sent from another device of the own account are now explicitly
tagged as carboned message. The session detection logic now uses this
tag to find "session borders".
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/MessageParser.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index f0659511..3aaa3ce7 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -230,6 +230,7 @@ public class MessageParser extends AbstractParser implements final MessagePacket packet; Long timestamp = null; final boolean isForwarded; + boolean isCarbon = false; String serverMsgId = null; final Element fin = original.findChild("fin", "urn:xmpp:mam:0"); if (fin != null) { @@ -260,7 +261,8 @@ public class MessageParser extends AbstractParser implements return; } timestamp = f != null ? f.second : null; - isForwarded = f != null; + isCarbon = f != null; + isForwarded = isCarbon; } else { packet = original; isForwarded = false; @@ -346,6 +348,7 @@ public class MessageParser extends AbstractParser implements message.setCounterpart(counterpart); message.setRemoteMsgId(remoteMsgId); message.setServerMsgId(serverMsgId); + message.setCarbon(isCarbon); message.setTime(timestamp); message.markable = packet.hasChild("markable", "urn:xmpp:chat-markers:0"); if (conversation.getMode() == Conversation.MODE_MULTI) { |