fix: message request banner shows again

This commit is contained in:
0x330a 2023-06-30 16:35:40 +10:00
parent 21e747ee99
commit c2763de664
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
2 changed files with 3 additions and 5 deletions

View File

@ -449,9 +449,9 @@ public class ThreadDatabase extends Database {
" ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.ADDRESS + " ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.ADDRESS +
" LEFT OUTER JOIN " + GroupDatabase.TABLE_NAME + " LEFT OUTER JOIN " + GroupDatabase.TABLE_NAME +
" ON " + TABLE_NAME + "." + ADDRESS + " = " + GroupDatabase.TABLE_NAME + "." + GROUP_ID + " ON " + TABLE_NAME + "." + ADDRESS + " = " + GroupDatabase.TABLE_NAME + "." + GROUP_ID +
" WHERE " + MESSAGE_COUNT + " != 0 AND " + ARCHIVED + " = 0 AND " + HAS_SENT + " = 0 AND " + MESSAGE_COUNT + " = " + UNREAD_COUNT + " AND " + " WHERE " + MESSAGE_COUNT + " != 0 AND " + ARCHIVED + " = 0 AND " + HAS_SENT + " = 0 AND " +
RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.BLOCK + " = 0 AND " +
RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.APPROVED + " = 0 AND " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.APPROVED + " = 0 AND " +
RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.BLOCK + " = 0 AND " +
GroupDatabase.TABLE_NAME + "." + GROUP_ID + " IS NULL"; GroupDatabase.TABLE_NAME + "." + GROUP_ID + " IS NULL";
cursor = db.rawQuery(query, null); cursor = db.rawQuery(query, null);
@ -766,12 +766,10 @@ public class ThreadDatabase extends Database {
updateThread(threadId, count, getFormattedBodyFor(record), getAttachmentUriFor(record), updateThread(threadId, count, getFormattedBodyFor(record), getAttachmentUriFor(record),
record.getTimestamp(), record.getDeliveryStatus(), record.getDeliveryReceiptCount(), record.getTimestamp(), record.getDeliveryStatus(), record.getDeliveryReceiptCount(),
record.getType(), unarchive, record.getExpiresIn(), record.getReadReceiptCount()); record.getType(), unarchive, record.getExpiresIn(), record.getReadReceiptCount());
notifyConversationListListeners();
return false; return false;
} else { } else {
if (shouldDeleteEmptyThread) { if (shouldDeleteEmptyThread) {
deleteThread(threadId); deleteThread(threadId);
notifyConversationListListeners();
return true; return true;
} }
return false; return false;
@ -779,6 +777,7 @@ public class ThreadDatabase extends Database {
} finally { } finally {
if (reader != null) if (reader != null)
reader.close(); reader.close();
notifyConversationListListeners();
} }
} }

View File

@ -212,7 +212,6 @@ class BatchMessageReceiveJob(
} }
} }
} }
if (threadId == NO_THREAD_MAPPING) return@async
// increment unreads, notify, and update thread // increment unreads, notify, and update thread
// last seen will be the current last seen if not changed (re-computes the read counts for thread record) // last seen will be the current last seen if not changed (re-computes the read counts for thread record)
// might have been updated from a different thread at this point // might have been updated from a different thread at this point