mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 12:18:25 +00:00
fix: legacy message deletions working better now
This commit is contained in:
parent
b6a4fb9024
commit
2048e08c86
@ -77,7 +77,7 @@ class ExpirationSettingsViewModel(
|
||||
expirationConfig?.expirationTypeValue?.let { 0 /* Legacy */ } ?: -1
|
||||
}
|
||||
_selectedExpirationTimer.value = when(expirationConfig?.expirationType) {
|
||||
ExpirationType.DELETE_AFTER_SEND -> afterSendOptions.find { it.value.toIntOrNull() == expirationConfig?.durationSeconds }
|
||||
null, ExpirationType.DELETE_AFTER_SEND -> afterSendOptions.find { it.value.toIntOrNull() == expirationConfig?.durationSeconds }
|
||||
ExpirationType.DELETE_AFTER_READ -> afterReadOptions.find { it.value.toIntOrNull() == expirationConfig?.durationSeconds }
|
||||
else -> afterSendOptions.firstOrNull()
|
||||
}
|
||||
@ -107,7 +107,11 @@ class ExpirationSettingsViewModel(
|
||||
}
|
||||
|
||||
fun onSetClick() = viewModelScope.launch {
|
||||
val expiryType = _selectedExpirationType.value
|
||||
var typeValue = _selectedExpirationType.value
|
||||
if (typeValue == 0) {
|
||||
typeValue = ExpirationType.DELETE_AFTER_READ_VALUE
|
||||
}
|
||||
val expiryType = typeValue
|
||||
val expirationTimer = _selectedExpirationTimer.value?.value?.toIntOrNull() ?: 0
|
||||
val address = recipient.value?.address
|
||||
if (address == null || (expirationConfig?.expirationTypeValue == expiryType && expirationConfig?.durationSeconds == expirationTimer)) {
|
||||
|
@ -363,7 +363,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
setUpRecipientObserver()
|
||||
getLatestOpenGroupInfoIfNeeded()
|
||||
setUpBlockedBanner()
|
||||
setUpOutdatedClientBanner();
|
||||
setUpOutdatedClientBanner()
|
||||
binding!!.searchBottomBar.setEventListener(this)
|
||||
setUpSearchResultObserver()
|
||||
scrollToFirstUnreadMessageIfNeeded()
|
||||
|
@ -8,10 +8,10 @@ class ExpirationConfiguration(
|
||||
val expirationTypeValue: Int = -1,
|
||||
val updatedTimestampMs: Long = 0
|
||||
) {
|
||||
val isEnabled = durationSeconds > 0
|
||||
val expirationType: ExpirationType? = ExpirationType.valueOf(expirationTypeValue)
|
||||
val isEnabled = durationSeconds > 0 && expirationType != null
|
||||
|
||||
companion object {
|
||||
val isNewConfigEnabled = true /* TODO: System.currentTimeMillis() > 1_676_851_200_000 // 13/02/2023 */
|
||||
val isNewConfigEnabled = false /* TODO: System.currentTimeMillis() > 1_676_851_200_000 // 13/02/2023 */
|
||||
}
|
||||
}
|
@ -45,9 +45,9 @@ abstract class Message {
|
||||
expirationTimer = 0
|
||||
return
|
||||
}
|
||||
expirationTimer = config.durationSeconds
|
||||
lastDisappearingMessageChangeTimestamp = config.updatedTimestampMs
|
||||
if (config.isEnabled) {
|
||||
expirationTimer = config.durationSeconds
|
||||
lastDisappearingMessageChangeTimestamp = config.updatedTimestampMs
|
||||
expirationType = config.expirationType
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user