Files
bundesmessenger-ios/Config/AppConfiguration.swift
Frank Rotermund 67df1a3e95 chore: FOSS Merge 1.27.11 (MESSENGER-7276)
Merge commit 'af0b6d4be985d9f26e5111d3fa01389c7321949f' into feature/7276_FOSS_Merge_1_27_11

# Conflicts:
#	Config/AppVersion.xcconfig
#	Gemfile.lock
#	IDETemplateMacros.plist
#	Podfile
#	Podfile.lock
#	README.md
#	Riot/Modules/Authentication/AuthenticationCoordinator.swift
#	Riot/Modules/Room/CellData/RoomBubbleCellData.m
#	Riot/target.yml
#	RiotNSE/NotificationService.swift
#	RiotSwiftUI/Modules/Authentication/ServerSelection/AuthenticationServerSelectionModels.swift
#	RiotSwiftUI/Modules/Authentication/ServerSelection/AuthenticationServerSelectionViewModel.swift
#	RiotSwiftUI/Modules/Authentication/ServerSelection/Coordinator/AuthenticationServerSelectionCoordinator.swift
#	RiotSwiftUI/Modules/Authentication/ServerSelection/View/AuthenticationServerSelectionScreen.swift
#	RiotSwiftUI/Modules/Room/CompletionSuggestion/Service/CompletionSuggestionService.swift
#	fastlane/Fastfile
2025-05-16 14:06:20 +02:00

79 lines
3.3 KiB
Swift

//
// Copyright 2024 New Vector Ltd.
// Copyright 2020 Vector Creations Ltd
// Copyright (c) 2021 BWI GmbH
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Foundation
/// AppConfiguration is CommonConfiguration plus configurations dedicated to the app
class AppConfiguration: CommonConfiguration {
// MARK: - Global settings
override func setupSettings() {
super.setupSettings()
setupAppSettings()
}
private func setupAppSettings() {
// Enable CallKit for app
MXKAppSettings.standard()?.isCallKitEnabled = true
// Get modular widget events in rooms histories
// bwi: add additional event for nicknames
MXKAppSettings.standard()?.addSupportedEventTypes([kWidgetMatrixEventTypeString,
kWidgetModularEventTypeString,
BWIBuildSettings.shared.bwiUserLabelEventTypeString,
VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType])
// Hide undecryptable messages that were sent while the user was not in the room
MXKAppSettings.standard()?.hidePreJoinedUndecryptableEvents = true
// Enable long press on event in bubble cells
MXKRoomBubbleTableViewCell.disableLongPressGesture(onEvent: false)
// Each room member will be considered as a potential contact.
MXKContactManager.shared().contactManagerMXRoomSource = MXKContactManagerMXRoomSource.all
// Use UIKit BackgroundTask for handling background tasks in the SDK
MXSDKOptions.sharedInstance().backgroundModeHandler = MXUIKitBackgroundModeHandler()
// Enable key backup on app
MXSDKOptions.sharedInstance().enableKeyBackupWhenStartingMXCrypto = true
// bwi: explicitly set option for key sharing
MXSDKOptions.sharedInstance().enableRoomSharedHistoryOnInvite = BWIBuildSettings.shared.allowKeySharingOnRoomInvite
// bwi: #4941 deactivate voice broadcast
RiotSettings.shared.enableVoiceBroadcast = BWIBuildSettings.shared.enableFeatureVoiceBroadcastsByDefault
// bwi: #5506 activate use latest avatar
RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName = BWIBuildSettings.shared.enableRoomScreenUseOnlyLatestUserAvatarAndNameByDefault
}
// MARK: - Per matrix session settings
override func setupSettings(for matrixSession: MXSession) {
super.setupSettings(for: matrixSession)
setupWidgetReadReceipts(for: matrixSession)
if BWIBuildSettings.shared.enableAntivirusScan, let homeServerStringURL = matrixSession.credentials?.homeServer {
matrixSession.antivirusServerURL = homeServerStringURL
}
}
private func setupWidgetReadReceipts(for matrixSession: MXSession) {
var acknowledgableEventTypes = matrixSession.acknowledgableEventTypes ?? []
acknowledgableEventTypes.append(kWidgetMatrixEventTypeString)
acknowledgableEventTypes.append(kWidgetModularEventTypeString)
matrixSession.acknowledgableEventTypes = acknowledgableEventTypes
}
}