From 1676e97bc66bb515439ef35584c70e448a386224 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Mon, 26 Jun 2023 15:19:17 +1000 Subject: [PATCH] chore: remove debug logs --- .../org/thoughtcrime/securesms/ApplicationContext.java | 2 +- .../conversation/v2/ConversationActivityV2.kt | 3 +-- .../org/thoughtcrime/securesms/database/Storage.kt | 10 ++++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java index b0d9bf9161..3b05918f7f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java @@ -108,7 +108,6 @@ import dagger.hilt.EntryPoints; import dagger.hilt.android.HiltAndroidApp; import kotlin.Unit; import kotlinx.coroutines.Job; -import network.loki.messenger.BuildConfig; import network.loki.messenger.libsession_util.ConfigBase; import network.loki.messenger.libsession_util.UserProfile; @@ -500,6 +499,7 @@ public class ApplicationContext extends Application implements DefaultLifecycleO }); } catch (Exception exception) { // Do nothing + Log.e("Loki-Avatar", "Uploading avatar failed", exception); } }); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index d953aa7330..e02f1ee4c0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -176,7 +176,6 @@ import java.lang.ref.WeakReference import java.util.Locale import java.util.concurrent.ExecutionException import java.util.concurrent.atomic.AtomicBoolean -import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.atomic.AtomicReference import javax.inject.Inject @@ -788,7 +787,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe viewModel.updateRecipient() runOnUiThread { - val threadRecipient = viewModel.recipient ?: return@runOnUiThread Log.d("Loki-DBG", "Recipient no longer here, go back?") + val threadRecipient = viewModel.recipient ?: return@runOnUiThread if (threadRecipient.isContactRecipient) { binding?.blockedBanner?.isVisible = threadRecipient.isBlocked } 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 9a47f362c5..ca56717a33 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -567,8 +567,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co val existingThread = existingGroup?.let { getThreadId(existingGroup.encodedId) } if (existingGroup != null) { if (group.priority == PRIORITY_HIDDEN && existingThread != null) { - threadDb.deleteConversation(existingThread) - // TODO: stop polling here also + ClosedGroupManager.silentlyRemoveGroup(context,existingThread,GroupUtil.doubleDecodeGroupId(existingGroup.encodedId), existingGroup.encodedId, localUserPublicKey, delete = true) } else if (existingThread == null) { Log.w("Loki-DBG", "Existing group had no thread to hide") } else { @@ -866,7 +865,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co // TODO: probably add a check in here for isActive? // TODO: also check if local user is a member / maybe run delete otherwise? val existingGroup = getGroup(groupID) - ?: return Log.w("Loki-DBG", "No existing group for ${groupPublicKey.take(4)}...${groupPublicKey.takeLast(4)} when updating group config") + ?: return Log.w("Loki-DBG", "No existing group for ${groupPublicKey.take(4)}} when updating group config") val userGroups = configFactory.userGroups ?: return if (!existingGroup.isActive) { userGroups.eraseLegacyGroup(groupPublicKey) @@ -877,7 +876,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co val members = existingGroup.members.map { it.serialize() } val membersMap = GroupUtil.createConfigMemberMap(admins = admins, members = members) val latestKeyPair = getLatestClosedGroupEncryptionKeyPair(groupPublicKey) - ?: return Log.w("Loki-DBG", "No latest closed group encryption key pair for ${groupPublicKey.take(4)}...${groupPublicKey.takeLast(4)} when updating group config") + ?: return Log.w("Loki-DBG", "No latest closed group encryption key pair for ${groupPublicKey.take(4)}} when updating group config") val recipientSettings = getRecipientSettings(groupAddress) ?: return val threadID = getThreadId(groupAddress) ?: return val groupInfo = userGroups.getOrConstructLegacyGroupInfo(groupPublicKey).copy( @@ -1309,7 +1308,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co volatile.eraseLegacyClosedGroup(groupPublicKey) groups.eraseLegacyGroup(groupPublicKey) } else { - Log.w("Loki-DBG", "Failed to find a closed group for $groupPublicKey, ${recipient.address.serialize()}") + Log.w("Loki-DBG", "Failed to find a closed group for ${groupPublicKey.take(4)}") } } } @@ -1610,7 +1609,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co } val contactsConfig = configFactory.contacts ?: return if (contactsConfig.needsPush() && !fromConfigUpdate) { - Log.d("Loki-DBG", "Needs to push contacts after blocking ${recipients.map { it.toShortString() }}") ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(context) } }