mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
Merge commit 'aaadcc73674cc8886e363693a7d7c08ac9b4f516' into feature/4260_merge_foss_1_10_2
# Conflicts: # Config/AppVersion.xcconfig # Podfile # Podfile.lock # Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved # Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift # Riot/Modules/Application/LegacyAppDelegate.m # Riot/Modules/Authentication/AuthenticationCoordinator.swift # Riot/Modules/Authentication/Legacy/LegacyAuthenticationCoordinator.swift # Riot/Modules/ContextMenu/ActionProviders/RoomActionProvider.swift # Riot/Modules/Home/AllChats/AllChatsViewController.swift # Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift # Riot/Modules/Room/Settings/RoomSettingsViewController.m # fastlane/Fastfile
This commit is contained in:
@@ -42,6 +42,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
private var ongoingVoIPPushRequests: [String: Bool] = [:]
|
||||
|
||||
private var userAccount: MXKAccount?
|
||||
private var isCryptoSDKEnabled = false
|
||||
|
||||
/// Best attempt contents. Will be updated incrementally, if something fails during the process, this best attempt content will be showed as notification. Keys are eventId's
|
||||
private var bestAttemptContents: [String: UNMutableNotificationContent] = [:]
|
||||
@@ -268,9 +269,10 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
self.userAccount = MXKAccountManager.shared()?.activeAccounts.first
|
||||
if let userAccount = userAccount {
|
||||
Self.backgroundServiceInitQueue.sync {
|
||||
if NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials {
|
||||
if hasChangedCryptoSDK() || NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials {
|
||||
MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE")
|
||||
self.logMemory()
|
||||
|
||||
NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials, persistTokenDataHandler: { persistTokenDataHandler in
|
||||
MXKAccountManager.shared().readAndWriteCredentials(persistTokenDataHandler)
|
||||
}, unauthenticatedHandler: { error, softLogout, refreshTokenAuth, completion in
|
||||
@@ -287,6 +289,16 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
}
|
||||
}
|
||||
|
||||
/// Determine whether we have switched from using crypto v1 to v2 or vice versa which will require
|
||||
/// rebuilding `MXBackgroundSyncService`
|
||||
private func hasChangedCryptoSDK() -> Bool {
|
||||
guard isCryptoSDKEnabled != RiotSettings.shared.enableCryptoSDK else {
|
||||
return false
|
||||
}
|
||||
isCryptoSDKEnabled = RiotSettings.shared.enableCryptoSDK
|
||||
return true
|
||||
}
|
||||
|
||||
/// Attempts to preprocess payload and attach room display name to the best attempt content
|
||||
/// - Parameters:
|
||||
/// - eventId: Event identifier to mutate best attempt content
|
||||
|
||||
@@ -23,4 +23,6 @@
|
||||
|
||||
#import "BuildInfo.h"
|
||||
|
||||
#import "ThemeService.h"
|
||||
|
||||
#endif /* RiotNSE_Bridging_Header_h */
|
||||
|
||||
@@ -33,6 +33,7 @@ targets:
|
||||
|
||||
dependencies:
|
||||
- package: DeviceKit
|
||||
- package: DTCoreText
|
||||
|
||||
configFiles:
|
||||
Debug: Debug.xcconfig
|
||||
@@ -88,3 +89,5 @@ targets:
|
||||
- "**/*.md" # excludes all files with the .md extension
|
||||
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
|
||||
- path: ../Riot/Modules/VoiceBroadcast/VoiceBroadcastSDK/MatrixSDK
|
||||
- path: ../Riot/Managers/Theme
|
||||
- path: ../Riot/Categories/UIColor.swift
|
||||
|
||||
Reference in New Issue
Block a user