aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs')
-rw-r--r--src/eu/siacs/conversations/persistance/DatabaseBackend.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
index e2067141..81d4e4fb 100644
--- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -3,6 +3,7 @@ package eu.siacs.conversations.persistance;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
@@ -120,7 +121,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
}
public List<Message> getMessages(Conversation conversation, int limit) {
- List<Message> list = new ArrayList<Message>();
+ List<Message> list = new CopyOnWriteArrayList<Message>();
SQLiteDatabase db = this.getReadableDatabase();
String[] selectionArgs = { conversation.getUuid() };
Cursor cursor = db.query(Message.TABLENAME, null, Message.CONVERSATION