chore: remove debug logs

This commit is contained in:
0x330a 2023-06-26 15:19:17 +10:00
parent 106b6283bb
commit 1676e97bc6
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
3 changed files with 6 additions and 9 deletions

View File

@ -108,7 +108,6 @@ import dagger.hilt.EntryPoints;
import dagger.hilt.android.HiltAndroidApp; import dagger.hilt.android.HiltAndroidApp;
import kotlin.Unit; import kotlin.Unit;
import kotlinx.coroutines.Job; import kotlinx.coroutines.Job;
import network.loki.messenger.BuildConfig;
import network.loki.messenger.libsession_util.ConfigBase; import network.loki.messenger.libsession_util.ConfigBase;
import network.loki.messenger.libsession_util.UserProfile; import network.loki.messenger.libsession_util.UserProfile;
@ -500,6 +499,7 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
}); });
} catch (Exception exception) { } catch (Exception exception) {
// Do nothing // Do nothing
Log.e("Loki-Avatar", "Uploading avatar failed", exception);
} }
}); });
} }

View File

@ -176,7 +176,6 @@ import java.lang.ref.WeakReference
import java.util.Locale import java.util.Locale
import java.util.concurrent.ExecutionException import java.util.concurrent.ExecutionException
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
import javax.inject.Inject import javax.inject.Inject
@ -788,7 +787,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
viewModel.updateRecipient() viewModel.updateRecipient()
runOnUiThread { 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) { if (threadRecipient.isContactRecipient) {
binding?.blockedBanner?.isVisible = threadRecipient.isBlocked binding?.blockedBanner?.isVisible = threadRecipient.isBlocked
} }

View File

@ -567,8 +567,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
val existingThread = existingGroup?.let { getThreadId(existingGroup.encodedId) } val existingThread = existingGroup?.let { getThreadId(existingGroup.encodedId) }
if (existingGroup != null) { if (existingGroup != null) {
if (group.priority == PRIORITY_HIDDEN && existingThread != null) { if (group.priority == PRIORITY_HIDDEN && existingThread != null) {
threadDb.deleteConversation(existingThread) ClosedGroupManager.silentlyRemoveGroup(context,existingThread,GroupUtil.doubleDecodeGroupId(existingGroup.encodedId), existingGroup.encodedId, localUserPublicKey, delete = true)
// TODO: stop polling here also
} else if (existingThread == null) { } else if (existingThread == null) {
Log.w("Loki-DBG", "Existing group had no thread to hide") Log.w("Loki-DBG", "Existing group had no thread to hide")
} else { } 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: probably add a check in here for isActive?
// TODO: also check if local user is a member / maybe run delete otherwise? // TODO: also check if local user is a member / maybe run delete otherwise?
val existingGroup = getGroup(groupID) 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 val userGroups = configFactory.userGroups ?: return
if (!existingGroup.isActive) { if (!existingGroup.isActive) {
userGroups.eraseLegacyGroup(groupPublicKey) 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 members = existingGroup.members.map { it.serialize() }
val membersMap = GroupUtil.createConfigMemberMap(admins = admins, members = members) val membersMap = GroupUtil.createConfigMemberMap(admins = admins, members = members)
val latestKeyPair = getLatestClosedGroupEncryptionKeyPair(groupPublicKey) 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 recipientSettings = getRecipientSettings(groupAddress) ?: return
val threadID = getThreadId(groupAddress) ?: return val threadID = getThreadId(groupAddress) ?: return
val groupInfo = userGroups.getOrConstructLegacyGroupInfo(groupPublicKey).copy( val groupInfo = userGroups.getOrConstructLegacyGroupInfo(groupPublicKey).copy(
@ -1309,7 +1308,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
volatile.eraseLegacyClosedGroup(groupPublicKey) volatile.eraseLegacyClosedGroup(groupPublicKey)
groups.eraseLegacyGroup(groupPublicKey) groups.eraseLegacyGroup(groupPublicKey)
} else { } 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 val contactsConfig = configFactory.contacts ?: return
if (contactsConfig.needsPush() && !fromConfigUpdate) { if (contactsConfig.needsPush() && !fromConfigUpdate) {
Log.d("Loki-DBG", "Needs to push contacts after blocking ${recipients.map { it.toShortString() }}")
ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(context) ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(context)
} }
} }