sync around Conversation.getLatestMessage()
This commit is contained in:
parent
4d1b6d4404
commit
8de81e0bc8
|
@ -470,6 +470,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
||||||
}
|
}
|
||||||
|
|
||||||
public Message getLatestMessage() {
|
public Message getLatestMessage() {
|
||||||
|
synchronized (this.messages) {
|
||||||
if (this.messages.size() == 0) {
|
if (this.messages.size() == 0) {
|
||||||
Message message = new Message(this, "", Message.ENCRYPTION_NONE);
|
Message message = new Message(this, "", Message.ENCRYPTION_NONE);
|
||||||
message.setType(Message.TYPE_STATUS);
|
message.setType(Message.TYPE_STATUS);
|
||||||
|
@ -479,6 +480,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
||||||
return this.messages.get(this.messages.size() - 1);
|
return this.messages.get(this.messages.size() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if (getMode() == MODE_MULTI) {
|
if (getMode() == MODE_MULTI) {
|
||||||
|
|
Loading…
Reference in a new issue