mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-05 00:35:01 -05:00
fixed bug in find conference in database method
This commit is contained in:
parent
00c74503ab
commit
2dc69eea68
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user