Fixed issue in previous commit

This commit is contained in:
Sylvain Berfini 2026-03-05 12:10:12 +01:00
parent b16b42ce55
commit 15603e7933
3 changed files with 7 additions and 7 deletions

View file

@ -222,8 +222,8 @@ class CorePreferences
}
@get:AnyThread @set:WorkerThread
var hideChatMessageContentInNotification: Boolean
get() = config.getBool("ui", "display_notification_content", false)
var showChatMessageContentInNotification: Boolean
get() = config.getBool("ui", "display_notification_content", true)
set(value) {
config.setBool("ui", "display_notification_content", value)
}

View file

@ -1600,10 +1600,10 @@ class NotificationsManager
}
val senderPerson = if (message.isOutgoing) null else person // Use null for ourselves
val text = if (corePreferences.hideChatMessageContentInNotification) {
AppUtils.getString(R.string.notification_chat_message_hidden_content)
} else {
val text = if (corePreferences.showChatMessageContentInNotification) {
message.message
} else {
AppUtils.getString(R.string.notification_chat_message_hidden_content)
}
val tmp = NotificationCompat.MessagingStyle.Message(
text,

View file

@ -349,7 +349,7 @@ class SettingsViewModel
markAsReadWhenDismissingNotification.postValue(
corePreferences.markConversationAsReadWhenDismissingMessageNotification
)
hideMessageContentInNotification.postValue(corePreferences.hideChatMessageContentInNotification)
hideMessageContentInNotification.postValue(!corePreferences.showChatMessageContentInNotification)
sortContactsBy.postValue(if (corePreferences.sortContactsByFirstName) 0 else 1)
editNativeContactsInLinphone.postValue(corePreferences.editNativeContactsInLinphone)
@ -580,7 +580,7 @@ class SettingsViewModel
fun toggleHideMessageContentInNotification() {
val newValue = hideMessageContentInNotification.value == false
coreContext.postOnCoreThread {
corePreferences.hideChatMessageContentInNotification = newValue
corePreferences.showChatMessageContentInNotification = !newValue
hideMessageContentInNotification.postValue(newValue)
}
}