refactor: remove some logging, don't use blinded conversations in the list

This commit is contained in:
0x330a 2023-05-08 13:24:35 +10:00
parent d4f112e4b0
commit ebdfd2538d
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
3 changed files with 2 additions and 6 deletions

View File

@ -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

View File

@ -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())

View File

@ -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)) {