diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-22 14:19:03 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-22 14:19:03 +0200 |
commit | 60494b249b13b09319d6ff944935b6dbbf71ba6b (patch) | |
tree | 8d7a918c32497ecb4af61ebeb3a7b76ce8cc28d7 /src/main/java/de/pixart/messenger/entities | |
parent | 13f58b1708b37757a7c4e934badcdd09b9aa12d5 (diff) |
introduced sroll to bottom button
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index fa5e5ef60..8b3f06711 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -1110,6 +1110,25 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl && sentMessagesCount() == 0; } + public int getReceivedMessagesCountSinceUuid(String uuid) { + if (uuid == null) { + return 0; + } + int count = 0; + synchronized (this.messages) { + for (int i = messages.size() - 1; i >= 0; i--) { + final Message message = messages.get(i); + if (uuid.equals(message.getUuid())) { + return count; + } + if (message.getStatus() <= Message.STATUS_RECEIVED) { + ++count; + } + } + } + return 0; + } + public interface OnMessageFound { void onMessageFound(final Message message); } |