diff options
author | iNPUTmice <daniel@gultsch.de> | 2015-01-21 16:18:57 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2015-01-21 16:18:57 +0100 |
commit | 2dc69eea682997229b632f9009facd21b85b47f5 (patch) | |
tree | bfb62d93c83dcd7d7ef677a8de9bfff4c60f10f1 /src/main/java/eu/siacs | |
parent | 00c74503abf508b92d8704ed503ab5480e7cf5a1 (diff) |
fixed bug in find conference in database method
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 5fa61491..3ae3356d 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -220,10 +220,13 @@ public class DatabaseBackend extends SQLiteOpenHelper { public Conversation findConversation(final Account account, final Jid contactJid) { SQLiteDatabase db = this.getReadableDatabase(); - String[] selectionArgs = { account.getUuid(), contactJid.toBareJid().toString() + "%" }; + String[] selectionArgs = { account.getUuid(), + contactJid.toBareJid().toString() + "/%", + contactJid.toBareJid().toString() + }; Cursor cursor = db.query(Conversation.TABLENAME, null, - Conversation.ACCOUNT + "=? AND " + Conversation.CONTACTJID - + " like ?", selectionArgs, null, null, null); + Conversation.ACCOUNT + "=? AND (" + Conversation.CONTACTJID + + " like ? OR "+Conversation.CONTACTJID+"=?)", selectionArgs, null, null, null); if (cursor.getCount() == 0) return null; cursor.moveToFirst(); |