aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/entities
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-08-13 12:36:30 +0200
committerChristian Schneppe <christian@pix-art.de>2016-08-13 22:22:50 +0200
commit058f4395e55d7d774f79c576195e891f92d36984 (patch)
treed29f74aec7a3727c83c1241a7aa6ed08b3f5e945 /src/main/java/de/pixart/messenger/entities
parent1d1b58853c13e6e2c27a07b6b37a340d06562989 (diff)
make lastMessageTransmitted return max(clear_date,last_message)
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 11eff3f6e..b48eaa39f 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -817,19 +817,18 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
public long getLastMessageTransmitted() {
- long last_clear = getLastClearHistory();
- if (last_clear != 0) {
- return last_clear;
- }
+ final long last_clear = getLastClearHistory();
+ long last_received = 0;
synchronized (this.messages) {
for(int i = this.messages.size() - 1; i >= 0; --i) {
Message message = this.messages.get(i);
if (message.getStatus() == Message.STATUS_RECEIVED || message.isCarbon()) {
- return message.getTimeSent();
+ last_received = message.getTimeSent();
+ break;
}
}
}
- return 0;
+ return Math.max(last_clear,last_received);
}
public void setMutedTill(long value) {