code cleanup and synchronized getMarkableMessage()
This commit is contained in:
parent
995d975127
commit
d8d1c1192f
|
@ -456,13 +456,11 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
|||
}
|
||||
|
||||
public Message getLatestMarkableMessage() {
|
||||
synchronized (this.messages) {
|
||||
for (int i = this.messages.size() - 1; i >= 0; --i) {
|
||||
if (this.messages.get(i).getStatus() <= Message.STATUS_RECEIVED
|
||||
&& this.messages.get(i).markable) {
|
||||
if (this.messages.get(i).isRead()) {
|
||||
return null;
|
||||
} else {
|
||||
return this.messages.get(i);
|
||||
final Message message = this.messages.get(i);
|
||||
if (message.getStatus() <= Message.STATUS_RECEIVED && message.markable) {
|
||||
return message.isRead() ? null : message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue