diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-12-10 20:53:45 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-12-10 20:53:45 +0100 |
commit | 8e8a1f04800fce4618506ff2c47157f94bd6c489 (patch) | |
tree | a90f499aabbaf3c66f01ea98ec5599b24e9f5fc8 | |
parent | 06ed2863bd0bcccd6435bc092954021d288e7144 (diff) |
MAM: do not use private messages when finding last id in muc
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 9252842aa..030cf9664 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -875,7 +875,10 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl MamReference lastReceived = new MamReference(0); synchronized (this.messages) { for (int i = this.messages.size() - 1; i >= 0; --i) { - Message message = this.messages.get(i); + final Message message = this.messages.get(i); + if (message.getType() == Message.TYPE_PRIVATE) { + continue; //it's unsafe to use private messages as anchor. They could be coming from user archive + } if (message.getStatus() == Message.STATUS_RECEIVED || message.isCarbon() || message.getServerMsgId() != null) { lastReceived = new MamReference(message.getTimeSent(),message.getServerMsgId()); break; |