mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Merge remote-tracking branch 'refs/remotes/origin/disappear-2' into disappear-2
This commit is contained in:
commit
e2e5a36f51
@ -537,6 +537,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
updatePlaceholder()
|
||||
viewModel.recipient?.let {
|
||||
maybeUpdateToolbar(recipient = it)
|
||||
setUpOutdatedClientBanner()
|
||||
}
|
||||
}
|
||||
|
||||
@ -697,12 +698,14 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
|
||||
private fun setUpOutdatedClientBanner() {
|
||||
val legacyRecipient = viewModel.legacyBannerRecipient(this)
|
||||
if (ExpirationConfiguration.isNewConfigEnabled &&
|
||||
|
||||
val shouldShowLegacy = ExpirationConfiguration.isNewConfigEnabled &&
|
||||
legacyRecipient != null
|
||||
) {
|
||||
|
||||
binding?.outdatedBanner?.isVisible = shouldShowLegacy
|
||||
if (shouldShowLegacy) {
|
||||
binding?.outdatedBannerTextView?.text =
|
||||
resources.getString(R.string.activity_conversation_outdated_client_banner_text, legacyRecipient.name)
|
||||
binding?.outdatedBanner?.isVisible = true
|
||||
resources.getString(R.string.activity_conversation_outdated_client_banner_text, legacyRecipient!!.name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,6 @@ import org.session.libsession.messaging.jobs.MessageSendJob
|
||||
import org.session.libsession.messaging.jobs.RetrieveProfileAvatarJob
|
||||
import org.session.libsession.messaging.messages.Destination
|
||||
import org.session.libsession.messaging.messages.ExpirationConfiguration
|
||||
import org.session.libsession.messaging.messages.ExpirationConfiguration.Companion.isNewConfigEnabled
|
||||
import org.session.libsession.messaging.messages.Message
|
||||
import org.session.libsession.messaging.messages.control.ConfigurationMessage
|
||||
import org.session.libsession.messaging.messages.control.MessageRequestResponse
|
||||
@ -1733,6 +1732,11 @@ open class Storage(
|
||||
if (currentConfig != null && currentConfig.updatedTimestampMs >= config.updatedTimestampMs) return
|
||||
val expiryMode = config.expiryMode
|
||||
|
||||
if (expiryMode == ExpiryMode.NONE) {
|
||||
// Clear the legacy recipients on updating config to be none
|
||||
DatabaseComponent.get(context).lokiAPIDatabase().setLastLegacySenderAddress(recipient.address.serialize(), null)
|
||||
}
|
||||
|
||||
if (recipient.isClosedGroupRecipient) {
|
||||
val userGroups = configFactory.userGroups ?: return
|
||||
val groupPublicKey = GroupUtil.addressToGroupSessionId(recipient.address)
|
||||
|
@ -335,6 +335,17 @@ fun MessageReceiver.handleVisibleMessage(
|
||||
if (userPublicKey != messageSender && !isUserBlindedSender) {
|
||||
storage.setBlocksCommunityMessageRequests(recipient, message.blocksMessageRequests)
|
||||
}
|
||||
|
||||
// update the disappearing / legacy banner for the sender
|
||||
val disappearingState = when {
|
||||
proto.dataMessage.expireTimer > 0 && !proto.hasExpirationType() -> Recipient.DisappearingState.LEGACY
|
||||
else -> Recipient.DisappearingState.UPDATED
|
||||
}
|
||||
storage.updateDisappearingState(
|
||||
messageSender,
|
||||
threadID,
|
||||
disappearingState
|
||||
)
|
||||
}
|
||||
// Parse quote if needed
|
||||
var quoteModel: QuoteModel? = null
|
||||
|
Loading…
Reference in New Issue
Block a user