From 6ab4ff2e28dc958cfdd8572baa7fd825eaf72585 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:40:29 +1000 Subject: [PATCH] Compilation errors after merge --- .../securesms/ApplicationContext.java | 1 + .../conversation/v2/ConversationActivityV2.kt | 6 ++--- .../conversation/v2/ConversationViewModel.kt | 23 ------------------- .../v2/menus/ConversationMenuHelper.kt | 1 + 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java index 274682e837..20e6149790 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java @@ -113,6 +113,7 @@ import javax.inject.Inject; import dagger.hilt.EntryPoints; import dagger.hilt.android.HiltAndroidApp; +import kotlin.Unit; import network.loki.messenger.BuildConfig; import network.loki.messenger.R; 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 e7d412a77b..8b3d0b8c3e 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 @@ -898,8 +898,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe if (!isFinishing) { finish() } - - binding.inputBar.isGone = uiState.hideInputBar } } @@ -908,7 +906,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { viewModel.uiState.collect { state -> - binding?.inputBar?.run { + binding.inputBar.run { isVisible = state.showInput showMediaControls = state.enableInputMediaControls } @@ -1012,7 +1010,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } } - lifecycleScope.launch { + lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { viewModel.uiState .map { it.messageRequestState } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt index 1905ab306f..73fe8c60d3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt @@ -89,8 +89,6 @@ class ConversationViewModel( return repository.getInvitingAdmin(threadId) } - private var communityWriteAccessJob: Job? = null - private var _openGroup: RetrieveOnce = RetrieveOnce { storage.getOpenGroup(threadId) } @@ -150,27 +148,6 @@ class ConversationViewModel( } } } - - // listen to community write access updates from this point - communityWriteAccessJob?.cancel() - communityWriteAccessJob = viewModelScope.launch { - OpenGroupManager.getCommunitiesWriteAccessFlow() - .map { - if(openGroup?.groupId != null) - it[openGroup?.groupId] - else null - } - .filterNotNull() - .collect{ - // update our community object - _openGroup.updateTo(openGroup?.copy(canWrite = it)) - // when we get an update on the write access of a community - // we need to update the input text accordingly - _uiState.update { state -> - state.copy(hideInputBar = shouldHideInputBar()) - } - } - } } /** diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt index fe0ba1ac76..a03c04082a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt @@ -29,6 +29,7 @@ import org.session.libsession.messaging.groups.GroupManagerV2 import org.session.libsession.messaging.sending_receiving.MessageSender import org.session.libsession.messaging.sending_receiving.leave import org.session.libsession.utilities.GroupUtil.doubleDecodeGroupID +import org.session.libsession.utilities.StringSubstitutionConstants.APP_NAME_KEY import org.session.libsession.utilities.StringSubstitutionConstants.GROUP_NAME_KEY import org.session.libsession.utilities.TextSecurePreferences import org.session.libsession.utilities.recipients.Recipient