mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +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) {
|
private Cursor getConversationList(String archived) {
|
||||||
SQLiteDatabase db = databaseHelper.getReadableDatabase();
|
SQLiteDatabase db = databaseHelper.getReadableDatabase();
|
||||||
String localNumber = TextSecurePreferences.getLocalNumber(context);
|
String query = createQuery(ARCHIVED + " = ? AND " + MESSAGE_COUNT + " != 0", 0);
|
||||||
String query = createQuery(ARCHIVED + " = ? AND ("+TABLE_NAME+"."+ADDRESS+" != ? OR "+MESSAGE_COUNT+" != 0)", 0);
|
Cursor cursor = db.rawQuery(query, new String[]{archived});
|
||||||
Cursor cursor = db.rawQuery(query, new String[]{archived, localNumber});
|
|
||||||
|
|
||||||
setNotifyConverationListListeners(cursor);
|
setNotifyConverationListListeners(cursor);
|
||||||
|
|
||||||
@ -511,6 +510,14 @@ public class ThreadDatabase extends Database {
|
|||||||
MmsSmsDatabase mmsSmsDatabase = DatabaseFactory.getMmsSmsDatabase(context);
|
MmsSmsDatabase mmsSmsDatabase = DatabaseFactory.getMmsSmsDatabase(context);
|
||||||
long count = mmsSmsDatabase.getConversationCount(threadId);
|
long count = mmsSmsDatabase.getConversationCount(threadId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (count == 0) {
|
||||||
|
deleteThread(threadId);
|
||||||
|
notifyConversationListListeners();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
MmsSmsDatabase.Reader reader = null;
|
MmsSmsDatabase.Reader reader = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -524,6 +531,7 @@ public class ThreadDatabase extends Database {
|
|||||||
notifyConversationListListeners();
|
notifyConversationListListeners();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
deleteThread(threadId);
|
||||||
notifyConversationListListeners();
|
notifyConversationListListeners();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -141,6 +141,7 @@ object MultiDeviceProtocol {
|
|||||||
recipientDatabase.setProfileName(recipient, contact.name)
|
recipientDatabase.setProfileName(recipient, contact.name)
|
||||||
}
|
}
|
||||||
recipientDatabase.setProfileSharing(recipient, true)
|
recipientDatabase.setProfileSharing(recipient, true)
|
||||||
|
recipientDatabase.setRegistered(recipient, Recipient.RegisteredState.REGISTERED)
|
||||||
// create Thread if needed
|
// create Thread if needed
|
||||||
threadDatabase.getOrCreateThreadIdFor(recipient)
|
threadDatabase.getOrCreateThreadIdFor(recipient)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user