Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show encrypted message notification content by default. #4530

Merged
merged 5 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 3 additions & 5 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down