mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -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) {
|
public Conversation findConversation(final Account account, final Jid contactJid) {
|
||||||
SQLiteDatabase db = this.getReadableDatabase();
|
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,
|
Cursor cursor = db.query(Conversation.TABLENAME, null,
|
||||||
Conversation.ACCOUNT + "=? AND " + Conversation.CONTACTJID
|
Conversation.ACCOUNT + "=? AND (" + Conversation.CONTACTJID
|
||||||
+ " like ?", selectionArgs, null, null, null);
|
+ " like ? OR "+Conversation.CONTACTJID+"=?)", selectionArgs, null, null, null);
|
||||||
if (cursor.getCount() == 0)
|
if (cursor.getCount() == 0)
|
||||||
return null;
|
return null;
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
|
Loading…
Reference in New Issue
Block a user