mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
make lastMessageTransmitted return max(clear_date,last_message)
This commit is contained in:
parent
eb8b6165d7
commit
4736d12e99
@ -803,19 +803,18 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getLastMessageTransmitted() {
|
public long getLastMessageTransmitted() {
|
||||||
long last_clear = getLastClearHistory();
|
final long last_clear = getLastClearHistory();
|
||||||
if (last_clear != 0) {
|
long last_received = 0;
|
||||||
return last_clear;
|
|
||||||
}
|
|
||||||
synchronized (this.messages) {
|
synchronized (this.messages) {
|
||||||
for(int i = this.messages.size() - 1; i >= 0; --i) {
|
for(int i = this.messages.size() - 1; i >= 0; --i) {
|
||||||
Message message = this.messages.get(i);
|
Message message = this.messages.get(i);
|
||||||
if (message.getStatus() == Message.STATUS_RECEIVED || message.isCarbon()) {
|
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) {
|
public void setMutedTill(long value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user