mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 22:13:38 +00:00
Fix legacy expiration timer update handling
This commit is contained in:
parent
9e004cd09a
commit
8a51c8882c
@ -157,11 +157,11 @@ fun MessageReceiver.cancelTypingIndicatorsIfNeeded(senderPublicKey: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun MessageReceiver.handleExpirationTimerUpdate(message: ExpirationTimerUpdate) {
|
private fun MessageReceiver.handleExpirationTimerUpdate(message: ExpirationTimerUpdate) {
|
||||||
if (!ExpirationConfiguration.isNewConfigEnabled) return
|
if (ExpirationConfiguration.isNewConfigEnabled) return
|
||||||
val recipient = Recipient.from(MessagingModuleConfiguration.shared.context, Address.fromSerialized(message.sender!!), false)
|
val recipient = Recipient.from(MessagingModuleConfiguration.shared.context, Address.fromSerialized(message.sender!!), false)
|
||||||
val type = when {
|
val type = when {
|
||||||
recipient.isLocalNumber -> ExpirationType.DELETE_AFTER_READ
|
recipient.isContactRecipient -> ExpirationType.DELETE_AFTER_READ
|
||||||
recipient.isContactRecipient || recipient.isGroupRecipient -> ExpirationType.DELETE_AFTER_SEND
|
recipient.isGroupRecipient -> ExpirationType.DELETE_AFTER_SEND
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
SSKEnvironment.shared.messageExpirationManager.setExpirationTimer(message, type?.number)
|
SSKEnvironment.shared.messageExpirationManager.setExpirationTimer(message, type?.number)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user