aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java9
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();