From 87f40c679f582ffadf3bacc6fa569a7563288a91 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 18 Jun 2021 19:45:14 +0300 Subject: [PATCH 1/4] Recreate background sync service if credentials changed --- RiotNSE/NotificationService.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 3ac8cd0bd..85bdde3d5 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -163,7 +163,7 @@ class NotificationService: UNNotificationServiceExtension { MXKAccountManager.shared()?.forceReloadAccounts() self.userAccount = MXKAccountManager.shared()?.activeAccounts.first if let userAccount = userAccount { - if NotificationService.backgroundSyncService == nil { + if NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials { MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE") self.logMemory() NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials) From b042e6558661a18c96dc3dd7de3c1588787c2cb1 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 18 Jun 2021 19:46:00 +0300 Subject: [PATCH 2/4] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index ed19d3fdb..c2c909dde 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,6 +24,7 @@ Changes to be released in next version * VoIP: Handle application inactive state too for VoIP pushes (#4269). * VoIP: Do not terminate the app if protected data not available (#4419). * KeyVerification: Listen for request state changes and show QR reader option when it's ready. + * NSE: Recreate background sync service if credentials changed (#3695). ⚠️ API Changes * From 17bd76dc49ba19d431a79da33a4debedcb20eb1b Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Fri, 18 Jun 2021 19:26:55 +0200 Subject: [PATCH 3/4] UIButton: Add shortcut to button label property `adjustsFontForContentSizeCategory`. --- Riot/Categories/UIButton.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Riot/Categories/UIButton.swift b/Riot/Categories/UIButton.swift index 0e3af78ef..6f896bb58 100644 --- a/Riot/Categories/UIButton.swift +++ b/Riot/Categories/UIButton.swift @@ -40,4 +40,15 @@ extension UIButton { let image = UIImage.vc_image(from: color) self.setBackgroundImage(image, for: state) } + + /// Shortcut to button label property `adjustsFontForContentSizeCategory` + @IBInspectable + var vc_adjustsFontForContentSizeCategory: Bool { + get { + return self.titleLabel?.adjustsFontForContentSizeCategory ?? false + } + set { + self.titleLabel?.adjustsFontForContentSizeCategory = newValue + } + } } From 8c0411c4e5844b8e11ec639b107474a43bfe56db Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Fri, 18 Jun 2021 19:27:34 +0200 Subject: [PATCH 4/4] Side menu: Support Dynamic Type. --- Riot/Modules/SideMenu/SideMenuActionView.swift | 1 + Riot/Modules/SideMenu/SideMenuActionView.xib | 6 ++++++ Riot/Modules/SideMenu/SideMenuVersionView.xib | 2 +- Riot/Modules/SideMenu/SideMenuViewController.storyboard | 4 ++-- Riot/Modules/SideMenu/SideMenuViewController.swift | 5 ++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Riot/Modules/SideMenu/SideMenuActionView.swift b/Riot/Modules/SideMenu/SideMenuActionView.swift index 6d4dc27a6..72ff6a852 100644 --- a/Riot/Modules/SideMenu/SideMenuActionView.swift +++ b/Riot/Modules/SideMenu/SideMenuActionView.swift @@ -53,6 +53,7 @@ final class SideMenuActionView: UIView, NibOwnerLoadable { private func commonInit() { self.button.contentHorizontalAlignment = .left + self.button.titleLabel?.lineBreakMode = .byTruncatingTail } convenience init() { diff --git a/Riot/Modules/SideMenu/SideMenuActionView.xib b/Riot/Modules/SideMenu/SideMenuActionView.xib index b1ea1a367..c23367b54 100644 --- a/Riot/Modules/SideMenu/SideMenuActionView.xib +++ b/Riot/Modules/SideMenu/SideMenuActionView.xib @@ -21,11 +21,17 @@