mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Update disappearing messages client status banner display logic
This commit is contained in:
parent
d52fc4d70a
commit
9d056ff15b
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user