Update disappearing messages client status banner display logic

This commit is contained in:
charles 2022-12-19 14:10:12 +11:00
parent d52fc4d70a
commit 9d056ff15b

View File

@ -74,6 +74,7 @@ import org.session.libsession.utilities.Stub
import org.session.libsession.utilities.TextSecurePreferences import org.session.libsession.utilities.TextSecurePreferences
import org.session.libsession.utilities.concurrent.SimpleTask import org.session.libsession.utilities.concurrent.SimpleTask
import org.session.libsession.utilities.recipients.Recipient import org.session.libsession.utilities.recipients.Recipient
import org.session.libsession.utilities.recipients.Recipient.DisappearingState
import org.session.libsession.utilities.recipients.RecipientModifiedListener import org.session.libsession.utilities.recipients.RecipientModifiedListener
import org.session.libsignal.crypto.MnemonicCodec import org.session.libsignal.crypto.MnemonicCodec
import org.session.libsignal.utilities.IdPrefix import org.session.libsignal.utilities.IdPrefix
@ -389,6 +390,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
true, true,
screenshotObserver screenshotObserver
) )
binding?.toolbarContent?.update(recipient, viewModel.openGroup, viewModel.expirationConfiguration)
} }
override fun onPause() { override fun onPause() {
@ -568,10 +570,14 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
private fun setUpOutdatedClientBanner() { private fun setUpOutdatedClientBanner() {
val recipient = viewModel.recipient ?: return val recipient = viewModel.recipient ?: return
if (viewModel.expirationConfiguration?.isEnabled != true || !ExpirationConfiguration.isNewConfigEnabled) { return } if (viewModel.recipient?.disappearingState == DisappearingState.LEGACY &&
binding?.outdatedBannerTextView?.text = viewModel.expirationConfiguration?.isEnabled == true &&
resources.getString(R.string.activity_conversation_outdated_client_banner_text, recipient.name) !ExpirationConfiguration.isNewConfigEnabled
binding?.outdatedBanner?.isVisible = true ) {
binding?.outdatedBannerTextView?.text =
resources.getString(R.string.activity_conversation_outdated_client_banner_text, recipient.name)
binding?.outdatedBanner?.isVisible = true
}
} }
private fun setUpLinkPreviewObserver() { private fun setUpLinkPreviewObserver() {