diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-10-19 23:13:55 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-10-19 23:13:55 +0200 |
commit | a201f9e53f33109836a690488b9f8a98db4f5249 (patch) | |
tree | 41b010733e2efba6e1c7749a8459c7dec7fcaddf /src/eu/siacs/conversations/persistance | |
parent | e8bf75d79b74637d369d2a7134416c1f0852c420 (diff) |
got rid of copyonwrite array list for messages
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/persistance/DatabaseBackend.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java index d90b5c62..d3d6ccf2 100644 --- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -152,14 +152,14 @@ public class DatabaseBackend extends SQLiteOpenHelper { return list; } - public CopyOnWriteArrayList<Message> getMessages( + public ArrayList<Message> getMessages( Conversation conversations, int limit) { return getMessages(conversations, limit, -1); } - public CopyOnWriteArrayList<Message> getMessages(Conversation conversation, + public ArrayList<Message> getMessages(Conversation conversation, int limit, long timestamp) { - CopyOnWriteArrayList<Message> list = new CopyOnWriteArrayList<Message>(); + ArrayList<Message> list = new ArrayList<Message>(); SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor; if (timestamp == -1) { @@ -178,7 +178,9 @@ public class DatabaseBackend extends SQLiteOpenHelper { if (cursor.getCount() > 0) { cursor.moveToLast(); do { - list.add(Message.fromCursor(cursor)); + Message message = Message.fromCursor(cursor); + message.setConversation(conversation); + list.add(message); } while (cursor.moveToPrevious()); } return list; |