diff --git a/CHANGES.rst b/CHANGES.rst index 49dae406ae..e0140c1531 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,7 @@ Changes to be released in next version 🙌 Improvements * Room: Added support for Voice Messages (#4090, #4091, #4092, #4094, #4095, #4096) * Remove the directory section from the Rooms tab. + * Notifications: Show decrypted content is enabled by default (#4519). 🐛 Bugfix * Room: Fixed mentioning users from room info member details (#4583) diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 973085b4c1..ed613fa9bb 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -313,6 +313,9 @@ final class BuildSettings: NSObject { static let voiceMessagesEnabled = false + // MARK: - Notifications + static let decryptNotificationsByDefault: Bool = true + // MARK: - HTTP /// Additional HTTP headers will be sent by all requests. Not recommended to use request-specific headers, like `Authorization`. /// Empty dictionary by default. diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 32010f9bb4..ae55cf538b 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -4202,18 +4202,16 @@ - (void)setupUserDefaults [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; + // Migrates old UserDefaults values if showDecryptedContentInNotifications hasn't been set if (!RiotSettings.shared.isUserDefaultsMigrated) { [RiotSettings.shared migrate]; } - // Now use RiotSettings and NSUserDefaults to store `showDecryptedContentInNotifications` setting option - // Migrate this information from main MXKAccount to RiotSettings, if value is not in UserDefaults - + // Show encrypted message notification content by default. if (!RiotSettings.shared.isShowDecryptedContentInNotificationsHasBeenSetOnce) { - MXKAccount *currentAccount = [MXKAccountManager sharedManager].activeAccounts.firstObject; - RiotSettings.shared.showDecryptedContentInNotifications = currentAccount.showDecryptedContentInNotifications; + RiotSettings.shared.showDecryptedContentInNotifications = BuildSettings.decryptNotificationsByDefault; } }