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:
JanNiklas Grabowski
2023-02-15 14:56:55 +01:00
279 changed files with 7285 additions and 2433 deletions
+49 -4
View File
@@ -15,6 +15,7 @@
limitations under the License.
*/
import Combine
import Foundation
import Intents
import MatrixSDK
@@ -61,6 +62,8 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
}
private var currentSpaceId: String?
private var cancellables: Set<AnyCancellable> = .init()
private var pushRulesUpdater: PushRulesUpdater?
// MARK: Public
@@ -82,9 +85,10 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
// MARK: - Public methods
func start() {
self.setupLogger()
self.setupTheme()
self.excludeAllItemsFromBackup()
setupLogger()
setupTheme()
excludeAllItemsFromBackup()
setupPushRulesSessionEvents()
// Setup navigation router store
_ = NavigationRouterStore.shared
@@ -102,7 +106,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
if AppDelegate.theDelegate().isOffline {
self.splitViewCoordinator?.showAppStateIndicator(with: VectorL10n.networkOfflineTitle, icon: UIImage(systemName: "wifi.slash"))
} else {
self.splitViewCoordinator?.hideAppStateIndicator()
self.splitViewCoordinator?.hideAppStateIndicator()
}
}
@@ -260,6 +264,47 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
// Reload split view with selected space id
self.splitViewCoordinator?.start(with: spaceId)
}
private func setupPushRulesSessionEvents() {
let sessionReady = NotificationCenter.default.publisher(for: .mxSessionStateDidChange)
.compactMap { $0.object as? MXSession }
.filter { $0.state == .running }
.removeDuplicates { session1, session2 in
session1 == session2
}
sessionReady
.sink { [weak self] session in
self?.setupPushRulesUpdater(session: session)
}
.store(in: &cancellables)
let sessionClosed = NotificationCenter.default.publisher(for: .mxSessionStateDidChange)
.compactMap { $0.object as? MXSession }
.filter { $0.state == .closed }
sessionClosed
.sink { [weak self] _ in
self?.pushRulesUpdater = nil
}
.store(in: &cancellables)
}
private func setupPushRulesUpdater(session: MXSession) {
pushRulesUpdater = .init(notificationSettingsService: MXNotificationSettingsService(session: session))
let applicationDidBecomeActive = NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification).eraseOutput()
let needsCheckPublisher = applicationDidBecomeActive.merge(with: Just(())).eraseToAnyPublisher()
needsCheckPublisher
.sink { _ in
Task { @MainActor [weak self] in
await self?.pushRulesUpdater?.syncRulesIfNeeded()
}
}
.store(in: &cancellables)
}
}
// MARK: - LegacyAppDelegateDelegate
+18 -6
View File
@@ -634,6 +634,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
// Pause Voice Broadcast recording if needed
[VoiceBroadcastRecorderProvider.shared pauseRecording];
// Pause Voice Broadcast playing if needed
[VoiceBroadcastPlaybackProvider.shared pausePlayingInProgressVoiceBroadcast];
// bwi: the app is really going into background
self.isApplicationActiveFromSystemAlert = NO;
}
@@ -2341,6 +2344,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
// Clear cache
[self clearCache];
// Reset Crypto SDK configuration (labs flag for which crypto module to use)
[CryptoSDKConfiguration.shared disable];
// Reset key backup banner preferences
[SecureBackupBannerPreferences.shared reset];
@@ -2374,9 +2380,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
// Logout all matrix account
[[MXKAccountManager sharedManager] logoutWithCompletion:^{
// We reset allChatsOnboardingHasBeenDisplayed flag on logout
RiotSettings.shared.allChatsOnboardingHasBeenDisplayed = NO;
if (completion)
{
completion (YES);
@@ -2559,18 +2562,27 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
MXLogDebug(@"[AppDelegate] showLaunchAnimation");
UIView *launchLoadingView;
if (MXSDKOptions.sharedInstance.enableSyncProgress)
if (MXSDKOptions.sharedInstance.enableStartupProgress)
{
if (BWIBuildSettings.shared.showBUMLottieAnimation)
{
launchLoadingView = [BUMLaunchLoadingViewController makeView];
} else {
MXSession *mainSession = self.mxSessions.firstObject;
launchLoadingView = [LaunchLoadingView instantiateWithSyncProgress:mainSession.syncProgress];
if (MXSDKOptions.sharedInstance.enableStartupProgress)
{
MXSession *mainSession = self.mxSessions.firstObject;
launchLoadingView = [LaunchLoadingView instantiateWithStartupProgress:mainSession.startupProgress];
}
else
{
launchLoadingView = [LaunchLoadingView instantiateWithStartupProgress:nil];
}
[(LaunchLoadingView *) launchLoadingView updateWithTheme:ThemeService.shared.theme];
}
launchLoadingView.frame = window.bounds;
launchLoadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[window addSubview:launchLoadingView];
}