From cc8fdb58ddcc37040cf16519a5ab1b14f449449a Mon Sep 17 00:00:00 2001 From: charles Date: Tue, 29 Nov 2022 14:20:45 +1100 Subject: [PATCH] Remove off option from one-to-one conversation expiration settings --- .../expiration/ExpirationSettingsViewModel.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt index 7071c84e0e..85c440cdcb 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt @@ -66,8 +66,12 @@ class ExpirationSettingsViewModel( ExpirationType.DELETE_AFTER_READ -> afterReadOptions else -> emptyList() } - }.onEach { - _expirationTimerOptions.value = it + }.onEach { options -> + _expirationTimerOptions.value = if (recipient.value?.isLocalNumber == true || recipient.value?.isClosedGroupRecipient == true) { + options + } else { + options.slice(1 until options.size) + } }.launchIn(viewModelScope) }