aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-06-02 13:33:20 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-06-02 13:33:20 +0200
commitfe1cff016f3e1bccaf8287fb490380281cb13983 (patch)
treebaa6ad91654866a7cd256b237ab6362f0536835d /src/main/java/eu/siacs/conversations/entities
parentba5d0892a6114bd85ea667428518f6f75a096af3 (diff)
avoid unnessary muc mam queries when message count is 0 after subject
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index b5f604b0f..289ed4ea5 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -249,6 +249,12 @@ public class Conversation extends AbstractEntity implements Blockable {
this.mLastReceivedOtrMessageId = id;
}
+ public int countMessages() {
+ synchronized (this.messages) {
+ return this.messages.size();
+ }
+ }
+
public interface OnMessageFound {
public void onMessageFound(final Message message);