From ebdfd2538d875dcbf31eac7dde45e3f8f8cbd35c Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Mon, 8 May 2023 13:24:35 +1000 Subject: [PATCH] refactor: remove some logging, don't use blinded conversations in the list --- .../main/java/org/thoughtcrime/securesms/database/Storage.kt | 1 - .../org/thoughtcrime/securesms/database/ThreadDatabase.java | 5 +---- .../java/org/thoughtcrime/securesms/home/HomeActivity.kt | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt index a3bb4265df..1821b8d372 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -1205,7 +1205,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co val threadDB = DatabaseComponent.get(context).threadDatabase() threadDB.deleteConversation(threadID) if (recipient != null) { - Log.d("Loki-DBG", "Deleting conversation for ${recipient.address}") if (recipient.isContactRecipient) { if (recipient.isLocalNumber) return val contacts = configFactory.contacts ?: return diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java b/app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java index 31ffb3c189..ceda7da141 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java @@ -434,12 +434,9 @@ public class ThreadDatabase extends Database { String query = "SELECT COUNT (*) FROM " + TABLE_NAME + " LEFT OUTER JOIN " + RecipientDatabase.TABLE_NAME + " ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.ADDRESS + - " LEFT OUTER JOIN " + GroupDatabase.TABLE_NAME + - " 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 " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.BLOCK + " = 0 AND " + - RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.APPROVED + " = 0 AND " + - GroupDatabase.TABLE_NAME + "." + GROUP_ID + " IS NULL"; + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.APPROVED + " = 0"; cursor = db.rawQuery(query, null); if (cursor != null && cursor.moveToFirst()) diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt index 56a647493f..ed06c2dcfc 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt @@ -326,7 +326,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), } private fun setupMessageRequestsBanner() { - val messageRequestCount = threadDb.unapprovedConversationCount + threadDb.blindedConversationList.use { it.count } + val messageRequestCount = threadDb.unapprovedConversationCount // Set up message requests if (messageRequestCount > 0 && !textSecurePreferences.hasHiddenMessageRequests()) { with(ViewMessageRequestBannerBinding.inflate(layoutInflater)) {