diff --git a/Linphone/Core/CorePreferences.swift b/Linphone/Core/CorePreferences.swift index 0d22023b9..34288b7ac 100644 --- a/Linphone/Core/CorePreferences.swift +++ b/Linphone/Core/CorePreferences.swift @@ -321,6 +321,15 @@ class CorePreferences { } } + var showChatMessageContentInNotification: Bool { + get { + config.getBool(section: "ui", key: "display_notification_content", defaultValue: true) + } + set { + config.setBool(section: "ui", key: "display_notification_content", value: newValue) + } + } + var showDialogWhenCallingDeviceUuidDirectly: Bool { get { config.getBool(section: "app", key: "show_confirmation_dialog_zrtp_trust_call", defaultValue: true) diff --git a/Linphone/GeneratedGit.swift b/Linphone/GeneratedGit.swift index f3faa0096..5884cfddd 100644 --- a/Linphone/GeneratedGit.swift +++ b/Linphone/GeneratedGit.swift @@ -1,7 +1,7 @@ import Foundation public enum AppGitInfo { - public static let branch = "feature/contacts_and_suggestions_list" - public static let commit = "c3f95fe23" + public static let branch = "master" + public static let commit = "6c5bf4306" public static let tag = "6.1.0-alpha" } diff --git a/Linphone/Localizable/en.lproj/Localizable.strings b/Linphone/Localizable/en.lproj/Localizable.strings index b20503f5a..d234a0e94 100644 --- a/Linphone/Localizable/en.lproj/Localizable.strings +++ b/Linphone/Localizable/en.lproj/Localizable.strings @@ -539,6 +539,7 @@ "settings_contacts_ldap_empty_server_error_toast" = "Server URL can't be empty"; "settings_contacts_title" = "Contacts"; "settings_conversations_auto_download_title" = "Auto-download files"; +"settings_conversations_hide_message_content_in_notif_title" = "Do not show message content in iOS notification⁣"; "settings_conversations_mark_as_read_when_dismissing_notif_title" = "Mark conversation as read when dismissing message notification"; "settings_conversations_title" = "Conversations"; "settings_meetings_default_layout_title" = "Default layout"; diff --git a/Linphone/Localizable/fr.lproj/Localizable.strings b/Linphone/Localizable/fr.lproj/Localizable.strings index 55188cfe8..20d5d37a4 100644 --- a/Linphone/Localizable/fr.lproj/Localizable.strings +++ b/Linphone/Localizable/fr.lproj/Localizable.strings @@ -535,6 +535,7 @@ "settings_contacts_ldap_empty_server_error_toast" = "L'URL du serveur ne peut être vide"; "settings_contacts_title" = "Contacts"; "settings_conversations_auto_download_title" = "Télécharger automatiquement les fichiers"; +"settings_conversations_hide_message_content_in_notif_title" = "Masquer le contenu du message dans la notification iOS"; "settings_conversations_mark_as_read_when_dismissing_notif_title" = "Marquer la conversation comme lue lorsqu'une notification de message est supprimée"; "settings_conversations_title" = "Conversations"; "settings_meetings_default_layout_title" = "Disposition par défaut"; diff --git a/Linphone/UI/Main/Settings/Fragments/SettingsFragment.swift b/Linphone/UI/Main/Settings/Fragments/SettingsFragment.swift index 706260607..a58ec0690 100644 --- a/Linphone/UI/Main/Settings/Fragments/SettingsFragment.swift +++ b/Linphone/UI/Main/Settings/Fragments/SettingsFragment.swift @@ -234,6 +234,9 @@ struct SettingsFragment: View { VStack(spacing: 30) { Toggle("settings_conversations_auto_download_title", isOn: $settingsViewModel.autoDownload) .default_text_style_700(styleSize: 15) + + Toggle("settings_conversations_hide_message_content_in_notif_title", isOn: $settingsViewModel.hideNotificationContent) + .default_text_style_700(styleSize: 15) } .padding(.vertical, 30) .padding(.horizontal, 20) diff --git a/Linphone/UI/Main/Settings/ViewModel/SettingsViewModel.swift b/Linphone/UI/Main/Settings/ViewModel/SettingsViewModel.swift index bb4075e57..d000c4e13 100644 --- a/Linphone/UI/Main/Settings/ViewModel/SettingsViewModel.swift +++ b/Linphone/UI/Main/Settings/ViewModel/SettingsViewModel.swift @@ -37,6 +37,7 @@ class SettingsViewModel: ObservableObject { // Conversations settings @Published var autoDownload: Bool = false + @Published var hideNotificationContent: Bool = false // Contacts settings @Published var ldapServers: [String] = [] @@ -80,6 +81,7 @@ class SettingsViewModel: ObservableObject { let autoRecordTmp = AppServices.corePreferences.automaticallyStartCallRecording let autoDownloadTmp = core.maxSizeForAutoDownloadIncomingFiles == 0 + let hideNotificationContentTmp = !AppServices.corePreferences.showChatMessageContentInNotification let defaultLayoutTmp = core.defaultConferenceLayout.rawValue == 0 ? String(localized: "settings_meetings_layout_mosaic_label") : String(localized: "settings_meetings_layout_active_speaker_label") @@ -114,6 +116,7 @@ class SettingsViewModel: ObservableObject { self.autoRecord = autoRecordTmp self.autoDownload = autoDownloadTmp + self.hideNotificationContent = hideNotificationContentTmp self.defaultLayout = defaultLayoutTmp @@ -363,6 +366,10 @@ class SettingsViewModel: ObservableObject { core.maxSizeForAutoDownloadIncomingFiles = self.autoDownload ? 0 : -1 } + if AppServices.corePreferences.showChatMessageContentInNotification == self.hideNotificationContent { + AppServices.corePreferences.showChatMessageContentInNotification = !self.hideNotificationContent + } + if (core.defaultConferenceLayout.rawValue == 0) != (self.defaultLayout == String(localized: "settings_meetings_layout_mosaic_label")) { core.defaultConferenceLayout = self.defaultLayout == String(localized: "settings_meetings_layout_mosaic_label") ? .Grid : .ActiveSpeaker } diff --git a/msgNotificationService/NotificationService.swift b/msgNotificationService/NotificationService.swift index 92c32a794..b8e4d46fd 100644 --- a/msgNotificationService/NotificationService.swift +++ b/msgNotificationService/NotificationService.swift @@ -289,7 +289,7 @@ class NotificationService: UNNotificationServiceExtension { var msgData = MsgData(from: fromAddr, body: "", subtitle: "", callId: callId, localAddr: localUri, peerAddr: peerUri) - if let showMsg = lc!.config?.getBool(section: "app", key: "show_msg_in_notif", defaultValue: true), showMsg == true { + if let showMsg = lc!.config?.getBool(section: "ui", key: "display_notification_content", defaultValue: true), showMsg == true { msgData.subtitle = message.subject ?? from if reactionContent == nil { msgData.body = (message.subject != nil ? "\(from): " : "") + content