Pick correct config on receive message

This commit is contained in:
andrew 2023-11-10 12:51:58 +10:30
parent b0447cf342
commit 29099901d1

View File

@ -310,9 +310,9 @@ fun MessageReceiver.updateExpiryIfNeeded(
storage.updateDisappearingState(threadID, disappearingState) storage.updateDisappearingState(threadID, disappearingState)
} }
if (localConfig != null || localConfig!!) { remoteConfig.takeIf { localConfig == null || it.updatedTimestampMs > localConfig.updatedTimestampMs }
storage.setExpirationConfiguration(remoteConfig) ?.let(storage::setExpirationConfiguration)
}
if (message is ExpirationTimerUpdate) { if (message is ExpirationTimerUpdate) {
SSKEnvironment.shared.messageExpirationManager.setExpirationTimer(message, type?.expiryMode(durationSeconds.toLong())) SSKEnvironment.shared.messageExpirationManager.setExpirationTimer(message, type?.expiryMode(durationSeconds.toLong()))