mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
fix: revert query to filter empty threads for now
This commit is contained in:
parent
0120eac350
commit
4f74d46b17
@ -363,9 +363,8 @@ public class ThreadDatabase extends Database {
|
||||
|
||||
private Cursor getConversationList(String archived) {
|
||||
SQLiteDatabase db = databaseHelper.getReadableDatabase();
|
||||
String localNumber = TextSecurePreferences.getLocalNumber(context);
|
||||
String query = createQuery(ARCHIVED + " = ? AND ("+TABLE_NAME+"."+ADDRESS+" != ? OR "+MESSAGE_COUNT+" != 0)", 0);
|
||||
Cursor cursor = db.rawQuery(query, new String[]{archived, localNumber});
|
||||
String query = createQuery(ARCHIVED + " = ? AND " + MESSAGE_COUNT + " != 0", 0);
|
||||
Cursor cursor = db.rawQuery(query, new String[]{archived});
|
||||
|
||||
setNotifyConverationListListeners(cursor);
|
||||
|
||||
@ -511,6 +510,14 @@ public class ThreadDatabase extends Database {
|
||||
MmsSmsDatabase mmsSmsDatabase = DatabaseFactory.getMmsSmsDatabase(context);
|
||||
long count = mmsSmsDatabase.getConversationCount(threadId);
|
||||
|
||||
|
||||
|
||||
if (count == 0) {
|
||||
deleteThread(threadId);
|
||||
notifyConversationListListeners();
|
||||
return true;
|
||||
}
|
||||
|
||||
MmsSmsDatabase.Reader reader = null;
|
||||
|
||||
try {
|
||||
@ -524,6 +531,7 @@ public class ThreadDatabase extends Database {
|
||||
notifyConversationListListeners();
|
||||
return false;
|
||||
} else {
|
||||
deleteThread(threadId);
|
||||
notifyConversationListListeners();
|
||||
return true;
|
||||
}
|
||||
|
@ -141,6 +141,7 @@ object MultiDeviceProtocol {
|
||||
recipientDatabase.setProfileName(recipient, contact.name)
|
||||
}
|
||||
recipientDatabase.setProfileSharing(recipient, true)
|
||||
recipientDatabase.setRegistered(recipient, Recipient.RegisteredState.REGISTERED)
|
||||
// create Thread if needed
|
||||
threadDatabase.getOrCreateThreadIdFor(recipient)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user