Merge branch 'feature/3352_build_settings' into 'develop'

MESSENGER-3352 build settings

See merge request bwmessenger/bundesmessenger/bundesmessenger-ios!38
This commit is contained in:
Arnfried Griesert
2022-10-27 09:06:24 +00:00
103 changed files with 1013 additions and 1360 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ class AppConfiguration: CommonConfiguration {
// bwi: add additional event for nicknames
MXKAppSettings.standard()?.addSupportedEventTypes([kWidgetMatrixEventTypeString,
kWidgetModularEventTypeString,
BwiBuildSettings.bwiUserLabelEventTypeString])
BWIBuildSettings.shared.bwiUserLabelEventTypeString])
// Hide undecryptable messages that were sent while the user was not in the room
MXKAppSettings.standard()?.hidePreJoinedUndecryptableEvents = true
@@ -53,7 +53,7 @@ class AppConfiguration: CommonConfiguration {
MXSDKOptions.sharedInstance().enableKeyBackupWhenStartingMXCrypto = true
// bwi: explicitly set option for key sharing
MXSDKOptions.sharedInstance().enableRoomSharedHistoryOnInvite = BwiBuildSettings.allowKeySharingOnRoomInvite
MXSDKOptions.sharedInstance().enableRoomSharedHistoryOnInvite = BWIBuildSettings.shared.allowKeySharingOnRoomInvite
}
@@ -63,7 +63,7 @@ class AppConfiguration: CommonConfiguration {
super.setupSettings(for: matrixSession)
setupWidgetReadReceipts(for: matrixSession)
if BuildSettings.enableAntivirusScan, let homeServerStringURL = matrixSession.credentials?.homeServer {
if BWIBuildSettings.shared.enableAntivirusScan, let homeServerStringURL = matrixSession.credentials?.homeServer {
matrixSession.antivirusServerURL = homeServerStringURL
}
}
+494
View File
@@ -0,0 +1,494 @@
//
/*
* Copyright (c) 2022 BWI GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Foundation
import KeychainAccess
@objcMembers
class BWIBuildSettings: NSObject {
static let shared = BWIBuildSettings()
private let vault: KeyValueVault
override init() {
vault = KeychainVault(Keychain(service: BwiSettingsConstants.bwiSettingsKeychainService,
accessGroup: BuildSettings.keychainAccessGroup))
super.init()
overrideTargetSpecificSettings()
}
// MARK: -
private enum UserDefaultsKeys {
static let additionalBwiHeaderKey = "bwiHeader"
}
private struct BwiSettingsConstants {
static let bwiSettingsKeychainService: String = BuildSettings.baseBundleIdentifier + ".bwi-settings-service"
}
func reset() {
additionalBwiHeader = UserAgentService().bwiUserAgentDict
let sdkOptions = MXSDKOptions.sharedInstance()
sdkOptions.httpAdditionalHeaders = UserAgentService().bwiUserAgentDict
}
// MARK: Servers
var additionalBwiHeader: Dictionary<String, String> {
get {
do {
guard let data = try vault.data(forKey: UserDefaultsKeys.additionalBwiHeaderKey) else {
return UserAgentService().bwiUserAgentDict
}
var dict = try JSONDecoder().decode(Dictionary<String,String>.self, from: data)
dict["User-Agent"] = UserAgentService().bwiUserAgent
return dict
} catch {
return UserAgentService().bwiUserAgentDict
}
} set {
do {
let data = try JSONEncoder().encode(newValue)
try vault.set(data, forKey: UserDefaultsKeys.additionalBwiHeaderKey)
} catch let error {
NSLog("[PinCodePreferences] Error when storing addional header to the vault: \(error)")
}
}
}
// MARK: -
// Integration check
var forcedPinProtection = true
// Jailbreak check
var forcedNoneJailbroken = true
/// Default number of iterations for secure storage. Do not change this value after going live.
var iterationsForSecureStorage: UInt = 100000
/// Allow split view detail view stacking
var allowSplitViewDetailsScreenStacking = true
// direct rooms are for two persons only in bwi context
var allowInviteOnDirectRooms = false
// test setup for downtime: should be false for all builds
var useTestDataForDowntime = false
var flavor = ""
var showBwiSplashScreen = false
var bwiShowRoomSearch = false
var bwiAllowRoomPermalink = false
var bwiAllowUserPermalink = false
var bwiCheckAppVersion = true
var bwiNotificationTimes = true
var bwiUserLabelsAdminSettingsVisible = true
var bwiUserLabelsMemberDetailsVisible = true
var bwiUserLabelsParticipantsVisible = true
var bwiUserLabelsTimelineDisplayNameVisible = true
var bwiUserLabelsTimelineEventVisible = true
var bwiUserLabelEventTypeString = "de.bwi.room.user_function_labels"
var bwiUserLabelParticipantSorting = true
var bwiShowClosedPolls = true
var bwiShowThreads = false
var bwiShowRoomCreationSectionFooter = false
var bwiAutoCreateAliasOnRoomCreation = true
var bwiLocationShareButtonVisible = true
var bwiUseCustomPersonalNotesAvatar = true
var bwiBetterIgnoredUsers = true
var bwiSettingsShowInAppNotifications = false
var bwiFilteredContextMenu = true
var bwiShowPinnedNotificationSettings = false
var bwiShowSessionSettingsFooter = false
var bwiEnablePersonalState = false
// In onboarding splash screen dis/enable register button
var bwiOnboardingSplashScreenEnableRegister = false
// make sure that the NSE extention always resets message body and title
var bwiHideNotificationMessageBody = true
// in Auth screen dis/enable register button even with onboarding splash screen enabled
var bwiAuthentificationScreenEnableRegister = false
// enable BuM style authentication UI (more Info text and a logo)
var bwiEnableBuMAuthentificationUI = true
// voicemessages should resignplaying when the app enters the background
var bwiResignPlayingVoiceMessageInBackground = true
// enable BUM style UI in pincode and maybe other places
var bwiEnableBuMUI = true
// clear media cache every time when leaving a room vc: no media should be saved on device for security purposes
var bwiClearMediaCacheOnRoomExit = true
var bwiEnableLoginProtection = true
var bwiHashes = [ "a3f65e35a7476799afe8d80282fb3c45b39dab06d0d8c70dc98e45ab7d8e93a9",
"2fda1a831655c22a5e6096d7cfbff4429fbf27881141e191b46adbf168142a11",
"4f8cbb3fef885f7284d0477d797d7007f0e1ba76221834132652f4d645796e28",
"24c2ec541e61e8e68941b96dc45ed5df12f6bdbda283cb0b3a322742aa970256",
"1be0b314a6c915d4475290522baef5b642db1b6d68937992b8e0eb5b7b0d6666" ]
// use a different badge color if the user was mentioned in a room
var showMentionsInRoom = true
// replace feature history link variable with the appropiate build setting
var bwiFeatureHistoryLink = "https://messenger.bwi.de/#c4783"
var bwiReplaceFeatureLink = true
// login with matrix id should only be enabled in some configurations
var bwiEnableLoginWithMatrixID = true
// show app specific loading icons instead of the rotating element logo
var showBUMLottieAnimation = true
// DMs don't need all roomsettings (like changing avatar, name, topic)
var showUnrelatedRoomSettingsForDirectMessages = false
// create rooms without shared history
var enableSharedHistoryOnRoomCreation = false
// explicitly set sdk option for key sharing => We don't want to share even if the room setting allows it
var allowKeySharingOnRoomInvite = true
// DMs don't need all roomsettings (like changing avatar, name, topic)
var allowDoubleTapOnImageAttachmentsForZoom = true
// ------ End of BwiBuildSettings ---------
// Element-Web instance for the app
var applicationWebAppUrlString = ""
// Default servers proposed on the authentication screen
var serverConfigDefaultHomeserverUrlString = ""
var serverConfigDefaultIdentityServerUrlString = ""
var serverConfigPreSelections = ["":""]
var serverConfigSygnalAPIUrlString = ""
// Note: Set empty strings to hide the related entry in application settings
var applicationCopyrightUrlString = "https://messenger.bwi.de/copyright"
var applicationPrivacyPolicyUrlString = ""
// MARk: - Matrix permalinks
// Paths for URLs that will considered as Matrix permalinks. Those permalinks are opened within the app
var permalinkSupportedHosts: [String: [String]] = [:]
// MARK: - VoIP
var allowVoIPUsage = false
var stunServerFallbackUrlString: String? = ""
// MARK: - Public rooms Directory
// List of homeservers for the public rooms directory
var publicRoomsDirectoryServers = ["matrix.org"]
// MARK: - Analytics
/// BWI: set host and key to nil to disable PostHog tracking
var analyticsHost: String? = nil
var analyticsKey: String? = nil
var bwiAnalyticsServerUrlString = ""
var bwiAnalyticsAppId = "1"
/// The configuration to use for analytics during development. Set `isEnabled` to false to disable analytics in debug builds.
var analyticsConfiguration = BuildSettings.AnalyticsConfiguration(isEnabled: false,
host: "",
apiKey: "",
termsURL: URL(string: "https://element.io/cookie-policy")!)
// MARK: - Bug report
var bugReportEndpointUrlString = ""
// MARK: - Integrations
// Widgets in those paths require a scalar token
var integrationsScalarWidgetsPaths = [""]
// Jitsi server used outside integrations to create conference calls from the call button in the timeline
var jitsiServerUrl = URL(string: "https://enter.jitsi.url")!
var enableJSInWebView = false
// MARK: - Features
/// Setting to force protection by pin code
var forcePinProtection = true
/// Max allowed time to continue using the app without prompting PIN
var pinCodeGraceTimeInSeconds: TimeInterval = 180
var allowLocalContactsAccess = false
var allowInviteExernalUsers = false
var enableSideMenu = false
var sideMenuShowInviteFriends = false
// MARK: - Feature Specifics
/// Not allowed pin codes. User won't be able to select one of the pin in the list.
var notAllowedPINs: [String] = [
"1234",
"1111",
"0000",
"1212",
"7777",
"1004",
"2000",
"4444",
"2222",
"6969",
"9999",
"3333",
"5555",
"6666",
"1122",
"1313",
"8888",
"4321",
"2001",
"1010",
"2580",
"4711",
"0815",
"0852"
]
var allowLocalContactPresence = false
/// Indicates should the app log out the user when number of PIN failures reaches `maxAllowedNumberOfPinFailures`. Defaults to `false`
var logOutUserWhenPINFailuresExceeded = true
/// Indicates should the app log out the user when number of biometrics failures reaches `maxAllowedNumberOfBiometricsFailures`. Defaults to `false`
var logOutUserWhenBiometricsFailuresExceeded = true
/// If force is enabled the dialog for asking if reseting the key backup is not shown.. already asked before in mandatory verfication
var forceResetBackupIfLost = true
/// if skip is enabled the key backup dialogs are passed through
var skipKeyBackupStep = true
// MARK: - Main Tabs
var homeScreenShowHomeTab = false
// MARK: - General Settings Screen
var settingsScreenAllowAddingLinkedEmails = false
var settingsScreenAllowAddingPhoneNumbers = false
var settingsScreenAllowAddingEmailThreepids = false
var settingsScreenAllowAddingPhoneThreepids = false
var settingsScreenShowThreepidExplanatory = false
var settingsScreenShowDiscoverySettings = false
var settingsScreenAllowIdentityServerConfig = false
var settingsScreenShowConfirmMediaSize = false
var settingsScreenShowAdvancedSettings = false
var settingsScreenShowLabSettings = false
var settingsScreenAllowChangingRageshakeSettings = false
var settingsScreenAllowChangingCrashUsageDataSettings = false
var settingsScreenAllowBugReportingManually = false
var settingsScreenAllowDeactivatingAccount = false
var settingsScreenShowLinkPreviews = false
var settingsScreenShowInviteFriends = false
var settingsScreenShowSettings = true
var settingsScreenShowFeedback = false
var settingsScreenShowHelp = false
var settingsScreenShowNotificationDecodedContentOption = false
var settingsScreenShowSystemSettingsOption = false
var settingsScreenShowNsfwRoomsOption = false
var settingsScreenShowSupportSetting = true
var settingsSecurityScreenShowCryptographyInfo:Bool = false
var settingsSecurityScreenShowCryptographyExport:Bool = false
var settingsSecurityScreenShowAdvancedUnverifiedDevices:Bool = false
// MARK: - Notification Settings
var settingsNotificationsBWIDefaultSet = true
var settingsNotificationsShowDefault = true
var settingsNotificationsShowMentions = false
var settingsNotificationsShowAdvanced = false
// MARK: - Timeline settings
var roomInputToolbarCompressionMode: BuildSettings.MediaCompressionMode = .none
// MARK: - Room Creation Screen
var roomCreationScreenAllowEncryptionConfiguration = false
// MARK: - Room Screen
var roomScreenAllowStickerAction = false
// MARK: - Room Info Screen
var roomInfoScreenShowIntegrations = false
// MARK: - Room Settings Screen
var roomSettingsScreenShowLowPriorityOption = false
var roomSettingsScreenShowDirectChatOption = false
var roomSettingsScreenAllowChangingAccessSettings = false
var roomSettingsScreenAllowChangingHistorySettings = false
var roomSettingsScreenShowAddressSettings = false
var roomSettingsScreenShowAdvancedSettings = false
var roomSettingsScreenShowAccessSettingsBW = true
var roomSettingsScreenRemoveLeave = true
var roomSettingsScreenShowNotificationsV2 = false
// MARK: - Message
var messageDetailsAllowShare = false
var messageDetailsAllowPermalink = false
var messageDetailsAllowViewSource = false
var messageDetailsAllowSave = false
var messageDetailsAllowCopyMedia = false
var messageDetailsAllowPasteMedia = false
// MARK: - Authentication Screen
var authScreenShowRegister = false
var authScreenShowPhoneNumber = false
var authScreenShowForgotPassword = false
var authScreenShowCustomServerOptions = true
var authScreenShowTestServerOptions = true
var authScreenShowSocialLoginSection = false
// MARK: - Cross-signing (bwi=true)
var disableSelfUserVerification = true
// MARK: - Antivirus scan (bwi=true)
var enableAntivirusScan = false
// MARK: Verification screen (bwi=false)
var showRecoverWithKey = false
// MARK: Unified search screen (bwi=false)
var showUnifiedSearchViewMessagesTab = false
var showUnifiedSearchViewFilesTab = false
// MARK: - Onboarding
var onboardingShowAccountPersonalization = false
var onboardingEnableNewAuthenticationFlow = false
// ---
// MARK: Last message timestamp support (bwi=false)
var enableLastMessageTimestamp = false
// MARK: Invite friends in Direct Chat (bwi=false)
var directChatShowInviteFriends = false
// MARK: Last admin is not allowed to leave the room (bwi=true)
var lastAdminIsNotAllowedToLeaveRoom = true
// MARK: Room Member Details Screen (bwi=true)
var roomMemberDetailsHideLeaveButton = true
// MARK: Room create options (bwi=false)
var enableShowInRoomDirectory = false
// Mark: Unified Search (bwi=true)
var unifiedSearchScreenShowPublicDirectory = true
// MARK: Allows removal of uploaded avatar photos (bwi=true)
var enableRemoveAvatarImage = true
// MARK: Add a toggle button to the login screen to make the password visible
var passwordIndicatorOnLogin = true
// MARK: Displays the element base version on the settings screen
var elementBaseVersion = "1.9.8"
var showElementBaseVersion = true
// MARK: Bypasses the normal forgot password process by presenting the user an information alert
// (requires authScreenShowForgotPassword set to true)
var forgotPasswordInformationAlert = true
// MARK: Promote new feature within a banner below the navigation view
var showTopBanner = true
var showCustomServerDisplayName = true
var customServerDisplayName = ""
// MARK BWI show/hide developer menu
var bwiShowDeveloperSettings = false
// MARK BWI personal notes room
var bwiPersonalNotesRoom = false
var bwiPersonalNotesRoomLeavable = false
var bwiResetPersonalNotesAccountData = false
var bwiShowTimelineSettings = false
// MARK BWI personal state
var bwiPersonalState = false
// MARK BWI personal notes room
var bwiRollsAndRights = true
// MARK: Timeline
var settingsScreenShowSimpleTimeLineOptions = false
var settingsScreenShowTimeStampOption = true
var settingsScreenShowDeletedMessagesOption = false
var settingsScreenShowNameChangeOption = false
var settingsScreenShowChatEffectsOption = false
var settingsScreenShowRoomAvatarChangeOption = false
var settingsScreenShowUserAvatarChangeOption = true
var settingsScreenShowEnterRoomOption = true
var bwiLastAdminCanDowngradeHimself = false
var bwiEnableErrorTracking = false
var bwiEnableRegisterInfo = false
var bwiShowHappyBirthdayCampaign = false
var bwiHappyBirthdayCampaignIdentifier: String = "one_year_anniversary"
var bwiDisableSecuritySettingsUntrustedDevices = true
var bwiMatomoTrackingDefaultState = false
var bwiShowNewFeatures = true
// MARK: - Location Sharing
/// Overwritten by the home server's .well-known configuration (if any exists)
var defaultTileServerMapStyleURL = URL(string: "https://msgpriv.example.com/")!
// MARK: - Message Bubbles bwi show in our menu and only for beta builds
var bwiShowMessageBubbles = false
}
@@ -0,0 +1,32 @@
//
/*
* Copyright (c) 2022 BWI GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Foundation
extension BWIBuildSettings {
func overrideTargetSpecificSettings() {
authScreenShowRegister = true
showTopBanner = false
bwiShowDeveloperSettings = true
bwiPersonalState = true
bwiEnableErrorTracking = true
bwiMatomoTrackingDefaultState = true
bwiShowMessageBubbles = true
}
}
-572
View File
@@ -1,572 +0,0 @@
//
// Copyright 2020 Vector Creations Ltd
// Copyright (c) 2021 BWI GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
/// BuildSettings provides settings computed at build time.
/// In future, it may be automatically generated from xcconfig files
@objcMembers
final class BuildSettings: NSObject {
// MARK: - Bundle Settings
static var applicationGroupIdentifier: String {
guard let applicationGroupIdentifier = Bundle.app.object(forInfoDictionaryKey: "applicationGroupIdentifier") as? String else {
fatalError("applicationGroupIdentifier should be defined")
}
return applicationGroupIdentifier
}
static var baseBundleIdentifier: String {
guard let baseBundleIdentifier = Bundle.app.object(forInfoDictionaryKey: "baseBundleIdentifier") as? String else {
fatalError("baseBundleIdentifier should be defined")
}
return baseBundleIdentifier
}
static var keychainAccessGroup: String {
guard let keychainAccessGroup = Bundle.app.object(forInfoDictionaryKey: "keychainAccessGroup") as? String else {
fatalError("keychainAccessGroup should be defined")
}
return keychainAccessGroup
}
static var applicationURLScheme: String? {
guard let urlTypes = Bundle.app.object(forInfoDictionaryKey: "CFBundleURLTypes") as? [AnyObject],
let urlTypeDictionary = urlTypes.first as? [String: AnyObject],
let urlSchemes = urlTypeDictionary["CFBundleURLSchemes"] as? [AnyObject],
let externalURLScheme = urlSchemes.first as? String else {
return nil
}
return externalURLScheme
}
static var pushKitAppIdProd: String {
return baseBundleIdentifier + ".ios.voip.prod"
}
static var pushKitAppIdDev: String {
return baseBundleIdentifier + ".ios.voip.dev"
}
static var pusherAppIdProd: String {
return baseBundleIdentifier + ".ios.prod"
}
static var pusherAppIdDev: String {
return baseBundleIdentifier + ".ios.dev"
}
static var pushKitAppId: String {
#if DEBUG
return pushKitAppIdDev
#else
return pushKitAppIdProd
#endif
}
static var pusherAppId: String {
#if DEBUG
return pusherAppIdDev
#else
return pusherAppIdProd
#endif
}
// Element-Web instance for the app
static let applicationWebAppUrlString = ""
// MARK: - Localization
/// Whether to allow the app to use a right to left layout or force left to right for all languages
static let disableRightToLeftLayout = true
// MARK: - Server configuration
// Default servers proposed on the authentication screen
static let serverConfigDefaultHomeserverUrlString = ""
static let serverConfigDefaultIdentityServerUrlString = ""
static let serverConfigPreSelections = ["":""]
static let serverConfigSygnalAPIUrlString = ""
// MARK: - Legal URLs
// Note: Set empty strings to hide the related entry in application settings
static let applicationCopyrightUrlString = "https://messenger.bwi.de/copyright"
static let applicationPrivacyPolicyUrlString = ""
static let applicationTermsConditionsUrlString = "https://element.io/terms-of-service"
static let applicationHelpUrlString = "https://element.io/help"
// MARk: - Matrix permalinks
// Paths for URLs that will considered as Matrix permalinks. Those permalinks are opened within the app
static let permalinkSupportedHosts: [String: [String]] = [:]
// For use in clients that use a custom base url for permalinks rather than matrix.to.
// This baseURL is used to generate permalinks within the app (E.g. timeline message permalinks).
// Optional String that when set is used as permalink base, when nil matrix.to format is used.
// Example value would be "https://www.example.com", note there is no trailing '/'.
static let clientPermalinkBaseUrl: String? = ""
// MARK: - VoIP
static var allowVoIPUsage: Bool {
#if canImport(JitsiMeetSDK)
return false
#else
return false
#endif
}
static let stunServerFallbackUrlString: String? = ""
// MARK: - Public rooms Directory
// List of homeservers for the public rooms directory
static let publicRoomsDirectoryServers = [
"matrix.org",
"gitter.im"
]
// MARK: - Rooms Screen
static let roomsAllowToJoinPublicRooms: Bool = true
// MARK: - Analytics
// $$$
static let analyticsServerUrl = URL(string: "")
static let analyticsAppId = "0"
/// BWI: set host and key to nil to disable PostHog tracking
static let analyticsHost: String? = nil
static let analyticsKey: String? = nil
static let analyticsTermsURL = URL(string: "https://element.io/cookie-policy")!
static let bwiPresentAnalyticsPrompt = false
static let bwiAnalyticsServerUrlString = ""
static let bwiAnalyticsAppId = "1"
/// A type that represents how to set up the analytics module in the app.
///
/// **Note:** Analytics are disabled by default for forks.
/// If you are maintaining a fork, set custom configurations.
struct AnalyticsConfiguration {
/// Whether or not analytics should be enabled.
let isEnabled: Bool
/// The host to use for PostHog analytics.
let host: String
/// The public key for submitting analytics.
let apiKey: String
/// The URL to open with more information about analytics terms.
let termsURL: URL
}
/// The configuration to use for analytics during development. Set `isEnabled` to false to disable analytics in debug builds.
static let analyticsConfiguration = AnalyticsConfiguration(isEnabled: false,
host: "",
apiKey: "",
termsURL: URL(string: "https://element.io/cookie-policy")!)
// MARK: - Bug report
static let bugReportEndpointUrlString = ""
// Use the name allocated by the bug report server
static let bugReportApplicationId = "riot-ios"
static let bugReportUISIId = "element-auto-uisi"
// MARK: - Integrations
static let integrationsUiUrlString = "https://scalar.vector.im/"
static let integrationsRestApiUrlString = "https://scalar.vector.im/api"
// Widgets in those paths require a scalar token
static let integrationsScalarWidgetsPaths = [""]
// Jitsi server used outside integrations to create conference calls from the call button in the timeline
static let jitsiServerUrl: URL = URL(string: "https://enter.jitsi.url")!
// MARK: - Features
/// Setting to force protection by pin code
static let forcePinProtection: Bool = true
/// Max allowed time to continue using the app without prompting PIN
static let pinCodeGraceTimeInSeconds: TimeInterval = 180
/// Force non-jailbroken app usage
static let forceNonJailbrokenUsage: Bool = true
static let allowSendingStickers: Bool = false
static let allowLocalContactsAccess: Bool = false
static let allowInviteExernalUsers: Bool = false
static let enableSideMenu: Bool = false
static let sideMenuShowInviteFriends: Bool = false
/// Whether to read the `io.element.functional_members` state event and exclude any service members when computing a room's name and avatar.
static let supportFunctionalMembers: Bool = true
// MARK: - Feature Specifics
/// Not allowed pin codes. User won't be able to select one of the pin in the list.
static let notAllowedPINs: [String] = [
"1234",
"1111",
"0000",
"1212",
"7777",
"1004",
"2000",
"4444",
"2222",
"6969",
"9999",
"3333",
"5555",
"6666",
"1122",
"1313",
"8888",
"4321",
"2001",
"1010",
"2580",
"4711",
"0815",
"0852"
]
/// Maximum number of allowed pin failures when unlocking, before force logging out the user. Defaults to `3`
static let maxAllowedNumberOfPinFailures: Int = 3
/// Maximum number of allowed biometrics failures when unlocking, before fallbacking the user to the pin if set or logging out the user. Defaults to `5`
static let maxAllowedNumberOfBiometricsFailures: Int = 5
static let allowLocalContactPresence: Bool = false
/// Indicates should the app log out the user when number of PIN failures reaches `maxAllowedNumberOfPinFailures`. Defaults to `false`
static let logOutUserWhenPINFailuresExceeded: Bool = true
/// Indicates should the app log out the user when number of biometrics failures reaches `maxAllowedNumberOfBiometricsFailures`. Defaults to `false`
static let logOutUserWhenBiometricsFailuresExceeded: Bool = true
/// If force is enabled the dialog for asking if reseting the key backup is not shown.. already asked before in mandatory verfication
static let forceResetBackupIfLost: Bool = true
/// if skip is enabled the key backup dialogs are passed through
static let skipKeyBackupStep: Bool = true
static let showNotificationsV2: Bool = true
// MARK: - Main Tabs
static let homeScreenShowHomeTab: Bool = false
static let homeScreenShowFavouritesTab: Bool = true
static let homeScreenShowPeopleTab: Bool = true
static let homeScreenShowRoomsTab: Bool = true
// MARK: - General Settings Screen
static let settingsScreenShowUserFirstName: Bool = false
static let settingsScreenShowUserSurname: Bool = false
static let settingsScreenAllowAddingLinkedEmails: Bool = false
static let settingsScreenAllowAddingPhoneNumbers: Bool = false
static let settingsScreenAllowAddingEmailThreepids: Bool = false
static let settingsScreenAllowAddingPhoneThreepids: Bool = false
static let settingsScreenShowThreepidExplanatory: Bool = false
static let settingsScreenShowDiscoverySettings: Bool = false
static let settingsScreenAllowIdentityServerConfig: Bool = false
static let settingsScreenShowConfirmMediaSize: Bool = false
static let settingsScreenShowAdvancedSettings: Bool = false
static let settingsScreenShowLabSettings: Bool = false
static let settingsScreenAllowChangingRageshakeSettings: Bool = false
static let settingsScreenAllowChangingCrashUsageDataSettings: Bool = false
static let settingsScreenAllowBugReportingManually: Bool = false
static let settingsScreenAllowDeactivatingAccount: Bool = false
static let settingsScreenEnableDecodedContentAndGlobalSettings: Bool = false
static let settingsScreenShowChangePassword:Bool = true
static let settingsScreenShowLinkPreviews:Bool = false
static let settingsScreenShowInviteFriends:Bool = false
static let settingsScreenShowSettings:Bool = true
static let settingsScreenShowFeedback:Bool = false
static let settingsScreenShowHelp:Bool = false
static let settingsScreenShowEnableStunServerFallback: Bool = true
static let settingsScreenShowNotificationDecodedContentOption: Bool = false
static let settingsScreenShowSystemSettingsOption: Bool = false
static let settingsScreenShowNsfwRoomsOption: Bool = false
static let settingsScreenShowTACSetting: Bool = false
static let settingsScreenShowSupportSetting: Bool = true
static let settingsSecurityScreenShowSessions:Bool = true
static let settingsSecurityScreenShowSetupBackup:Bool = true
static let settingsSecurityScreenShowRestoreBackup:Bool = true
static let settingsSecurityScreenShowDeleteBackup:Bool = true
/// A setting to enable the presence configuration settings section.
static let settingsScreenPresenceAllowConfiguration: Bool = false
static let settingsSecurityScreenShowCryptographyInfo:Bool = false
static let settingsSecurityScreenShowCryptographyExport:Bool = false
static let settingsSecurityScreenShowAdvancedUnverifiedDevices:Bool = false
// MARK: - Notification Settings
static let settingsNotificationsBWIDefaultSet:Bool = true
static let settingsNotificationsShowDefault:Bool = true
static let settingsNotificationsShowMentions:Bool = false
static let settingsNotificationsShowAdvanced:Bool = false
// MARK: - Timeline settings
static let roomInputToolbarCompressionMode: MediaCompressionMode = .none
enum MediaCompressionMode {
case prompt, small, medium, large, none
}
// MARK: - Room Creation Screen
static let roomCreationScreenAllowEncryptionConfiguration: Bool = false
static let roomCreationScreenRoomIsEncrypted: Bool = true
static let roomCreationScreenAllowRoomTypeConfiguration: Bool = true
static let roomCreationScreenRoomIsPublic: Bool = false
// MARK: - Room Screen
static let roomScreenAllowVoIPForDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = true
static let roomScreenAllowCameraAction: Bool = true
static let roomScreenAllowMediaLibraryAction: Bool = true
static let roomScreenAllowStickerAction: Bool = false
static let roomScreenAllowFilesAction: Bool = true
// Timeline style
static let roomScreenAllowTimelineStyleConfiguration: Bool = true
static let roomScreenTimelineDefaultStyleIdentifier: RoomTimelineStyleIdentifier = .plain
static var isRoomScreenEnableMessageBubblesByDefault: Bool {
return self.roomScreenTimelineDefaultStyleIdentifier == .bubble
}
static let roomScreenUseOnlyLatestUserAvatarAndName: Bool = false
/// Allow split view detail view stacking
static let allowSplitViewDetailsScreenStacking: Bool = true
// MARK: - Room Contextual Menu
static let roomContextualMenuShowMoreOptionForMessages: Bool = true
static let roomContextualMenuShowMoreOptionForStates: Bool = true
static let roomContextualMenuShowReportContentOption: Bool = true
static let roomContextualMenuShowEncryptionOption: Bool = false
// MARK: - Room Info Screen
static let roomInfoScreenShowIntegrations: Bool = false
// MARK: - Room Settings Screen
static let roomSettingsScreenShowLowPriorityOption: Bool = false
static let roomSettingsScreenShowDirectChatOption: Bool = false
static let roomSettingsScreenAllowChangingAccessSettings: Bool = false
static let roomSettingsScreenAllowChangingHistorySettings: Bool = false
static let roomSettingsScreenShowAddressSettings: Bool = false
static let roomSettingsScreenShowAdvancedSettings: Bool = false
static let roomSettingsScreenShowAccessSettingsBW: Bool = true
static let roomSettingsScreenRemoveLeave: Bool = true
static let roomSettingsScreenAdvancedShowEncryptToVerifiedOption: Bool = true
static let roomSettingsScreenShowNotificationsV2: Bool = false
// MARK: - Room Member Screen
static let roomMemberScreenShowIgnore: Bool = true
// MARK: - Message
static let messageDetailsAllowShare: Bool = false
static let messageDetailsAllowPermalink: Bool = false
static let messageDetailsAllowViewSource: Bool = false
static let messageDetailsAllowSave: Bool = false
static let messageDetailsAllowCopyMedia: Bool = false
static let messageDetailsAllowPasteMedia: Bool = false
// MARK: - Notifications
static let decryptNotificationsByDefault: Bool = true
// MARK: - Authentication Screen
static let authScreenShowRegister = true
static let authScreenShowPhoneNumber = false
static let authScreenShowForgotPassword = false
static let authScreenShowCustomServerOptions = true
static let authScreenShowTestServerOptions = true
static let authScreenShowSocialLoginSection = false
// MARK: - Authentication Options
static let authEnableRefreshTokens = false
// MARK: - Cross-signing (bwi=true)
static let disableSelfUserVerification = true
// MARK: - Antivirus scan (bwi=true)
static let enableAntivirusScan = false
// MARK: - Room Screen
static let enableRoomSearchItem = false
// MARK: - Matomo Analytics (bwi=false)
static let enableMatomoAnalytics = true
// MARK: Verification screen (bwi=false)
static let showDetailedVerificationElements : Bool = false
static let showRecoverWithKey : Bool = false
// MARK: Unified search screen (bwi=false)
static let showUnifiedSearchViewMessagesTab : Bool = false
static let showUnifiedSearchViewFilesTab : Bool = false
// MARK: - Onboarding
static let onboardingShowAccountPersonalization = false
static let onboardingEnableNewAuthenticationFlow = false
// MARK: - Secrets Recovery
static let secretsRecoveryAllowReset = true
// MARK: VoIP support (bwi=false)
static let enableVoIPSupport : Bool = false
// MARK: - UISI Autoreporting
static let cryptoUISIAutoReportingEnabled = false
// MARK: - Polls
// MARK: Last message timestamp support (bwi=false)
static let enableLastMessageTimestamp : Bool = false
// MARK: Room chat alert screen (bwi=false)
static let enableViewEncryptionAction : Bool = false
// MARK: JavaScript support in WKWebView (bwi=false)
static let enableJSInWebView : Bool = false
// MARK: Secure pin code description (bwi=false)
static let settingsSettingsSecureShowPinCodeDescription : Bool = false
// MARK: Invite friends in Direct Chat (bwi=false)
static let directChatShowInviteFriends : Bool = false
// MARK: Last admin is not allowed to leave the room (bwi=true)
static let lastAdminIsNotAllowedToLeaveRoom : Bool = true
// MARK: Room Member Details Screen (bwi=true)
static let roomMemberDetailsHideLeaveButton : Bool = true
// MARK: Room create options (bwi=false)
static let enableShowInRoomDirectory : Bool = false
// MARK: sticker in composer (bwi=false)
static let enableRoomComposerSticker : Bool = false
// Mark: Unified Search (bwi=true)
static let unifiedSearchScreenShowPublicDirectory = true
// MARK: Allows removal of uploaded avatar photos (bwi=true)
static let enableRemoveAvatarImage = true
// MARK: Add a toggle button to the login screen to make the password visible
static let passwordIndicatorOnLogin : Bool = true
// MARK: Displays the element base version on the settings screen
static let elementBaseVersion : String = "1.9.8"
static let showElementBaseVersion : Bool = true
// MARK: Bypasses the normal forgot password process by presenting the user an information alert
// (requires authScreenShowForgotPassword set to true)
static let forgotPasswordInformationAlert : Bool = true
// MARK: Promote new feature within a banner below the navigation view
static let showTopBanner : Bool = false
static let showCustomServerDisplayName : Bool = true
static let customServerDisplayName : String = ""
// MARK BWI show/hide developer menu
static let bwiShowDeveloperSettings : Bool = true
// MARK BWI personal notes room
static let bwiPersonalNotesRoom : Bool = false
static let bwiPersonalNotesRoomLeavable : Bool = false
static let bwiResetPersonalNotesAccountData : Bool = false
static let bwiShowTimelineSettings : Bool = false
// MARK BWI personal state
static let bwiPersonalState : Bool = true
// MARK BWI personal notes room
static let bwiRollsAndRights : Bool = true
// MARK: Timeline
static let settingsScreenShowSimpleTimeLineOptions : Bool = false
static let settingsScreenShowTimeStampOption : Bool = true
static let settingsScreenShowDeletedMessagesOption : Bool = false
static let settingsScreenShowNameChangeOption : Bool = false
static let settingsScreenShowChatEffectsOption : Bool = false
static let settingsScreenShowRoomAvatarChangeOption : Bool = false
static let settingsScreenShowUserAvatarChangeOption : Bool = true
static let settingsScreenShowEnterRoomOption : Bool = true
static let bwiLastAdminCanDowngradeHimself : Bool = false
static let bwiEnableErrorTracking : Bool = true
static let bwiEnableRegisterInfo : Bool = false
static let bwiShowHappyBirthdayCampaign: Bool = false
static let bwiHappyBirthdayCampaignIdentifier: String = "one_year_anniversary"
static let bwiDisableSecuritySettingsUntrustedDevices: Bool = true
static let bwiShowMatomoInfoScreen = true
static let bwiShowMatomoSettings = true
static let bwiMatomoTrackingDefaultState = true
static let bwiShowNewFeatures = true
static let bwiSendMessageThreshold = 10.0
static let pollsEnabled = true
// MARK: - Location Sharing
/// Overwritten by the home server's .well-known configuration (if any exists)
static let defaultTileServerMapStyleURL = URL(string: "https://msgpriv.example.com/")!
static let locationSharingEnabled = true
// MARK: - MXKAppSettings
static let enableBotCreation: Bool = false
static let maxAllowedMediaCacheSize: Int = 1073741824
static let presenceColorForOfflineUser: Int = 15020851
static let presenceColorForOnlineUser: Int = 3401011
static let presenceColorForUnavailableUser: Int = 15066368
static let showAllEventsInRoomHistory: Bool = false
static let showLeftMembersInRoomMemberList: Bool = false
static let showRedactionsInRoomHistory: Bool = true
static let showUnsupportedEventsInRoomHistory: Bool = false
static let sortRoomMembersUsingLastSeenTime: Bool = true
static let syncLocalContacts: Bool = false
// MARK: - New App Layout
static let newAppLayoutEnabled = false
// MARK: - Device manager
static let deviceManagerEnabled = false
// MARK: - Message Bubbles bwi show in our menu and only for beta builds
static let bwiShowMessageBubbles = true
}
+25
View File
@@ -0,0 +1,25 @@
//
/*
* Copyright (c) 2022 BWI GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Foundation
extension BWIBuildSettings {
func overrideTargetSpecificSettings() {
}
}
+143 -275
View File
@@ -1,6 +1,5 @@
//
// Copyright 2020 Vector Creations Ltd
// Copyright (c) 2021 BWI GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -88,7 +87,8 @@ final class BuildSettings: NSObject {
}
// Element-Web instance for the app
static let applicationWebAppUrlString = ""
static let applicationWebAppUrlString = "https://app.element.io"
// MARK: - Localization
@@ -99,25 +99,42 @@ final class BuildSettings: NSObject {
// MARK: - Server configuration
// Default servers proposed on the authentication screen
static let serverConfigDefaultHomeserverUrlString = ""
static let serverConfigDefaultIdentityServerUrlString = ""
static let serverConfigDefaultHomeserverUrlString = "https://matrix.org"
static let serverConfigDefaultIdentityServerUrlString = "https://vector.im"
static let serverConfigPreSelections = ["":""]
static let serverConfigSygnalAPIUrlString = "https://matrix.org/_matrix/push/v1/notify"
static let serverConfigSygnalAPIUrlString = ""
// MARK: - Legal URLs
// Note: Set empty strings to hide the related entry in application settings
static let applicationCopyrightUrlString = "https://messenger.bwi.de/copyright"
static let applicationPrivacyPolicyUrlString = ""
static let applicationCopyrightUrlString = "https://element.io/copyright"
static let applicationPrivacyPolicyUrlString = "https://element.io/privacy"
static let applicationTermsConditionsUrlString = "https://element.io/terms-of-service"
static let applicationHelpUrlString = "https://element.io/help"
// MARk: - Matrix permalinks
// Paths for URLs that will considered as Matrix permalinks. Those permalinks are opened within the app
static let permalinkSupportedHosts: [String: [String]] = [:]
static let applicationHelpUrlString =
"https://element.io/help"
// MARK: - Permalinks
// Hosts/Paths for URLs that will considered as valid permalinks. Those permalinks are opened within the app.
static let permalinkSupportedHosts: [String: [String]] = [
"app.element.io": [],
"staging.element.io": [],
"develop.element.io": [],
"mobile.element.io": [""],
// Historical ones
"riot.im": ["/app", "/staging", "/develop"],
"www.riot.im": ["/app", "/staging", "/develop"],
"vector.im": ["/app", "/staging", "/develop"],
"www.vector.im": ["/app", "/staging", "/develop"],
// Official Matrix ones
"matrix.to": ["/"],
"www.matrix.to": ["/"],
// Client Permalinks (for use with `BuildSettings.clientPermalinkBaseUrl`)
// "example.com": ["/"],
// "www.example.com": ["/"],
]
// For use in clients that use a custom base url for permalinks rather than matrix.to.
// This baseURL is used to generate permalinks within the app (E.g. timeline message permalinks).
// Optional String that when set is used as permalink base, when nil matrix.to format is used.
@@ -127,37 +144,24 @@ final class BuildSettings: NSObject {
// MARK: - VoIP
static var allowVoIPUsage: Bool {
#if canImport(JitsiMeetSDK)
return false
return true
#else
return false
#endif
}
static let stunServerFallbackUrlString: String? = ""
static let stunServerFallbackUrlString: String? = "stun:turn.matrix.org"
// MARK: - Public rooms Directory
// List of homeservers for the public rooms directory
static let publicRoomsDirectoryServers = [
"matrix.org"
"matrix.org",
"gitter.im"
]
// MARK: - Rooms Screen
static let roomsAllowToJoinPublicRooms: Bool = true
// MARK: - Analytics
// $$$
static let analyticsServerUrl = URL(string: "")
static let analyticsAppId = "0"
/// BWI: set host and key to nil to disable PostHog tracking
static let analyticsHost: String? = nil
static let analyticsKey: String? = nil
static let analyticsTermsURL = URL(string: "https://element.io/cookie-policy")!
static let bwiPresentAnalyticsPrompt = false
static let bwiAnalyticsServerUrlString = ""
static let bwiAnalyticsAppId = "1"
/// A type that represents how to set up the analytics module in the app.
///
@@ -174,45 +178,67 @@ final class BuildSettings: NSObject {
let termsURL: URL
}
#if DEBUG
/// The configuration to use for analytics during development. Set `isEnabled` to false to disable analytics in debug builds.
static let analyticsConfiguration = AnalyticsConfiguration(isEnabled: false,
host: "",
apiKey: "",
static let analyticsConfiguration = AnalyticsConfiguration(isEnabled: BuildSettings.baseBundleIdentifier.starts(with: "im.vector.app"),
host: "https://posthog.element.dev",
apiKey: "phc_VtA1L35nw3aeAtHIx1ayrGdzGkss7k1xINeXcoIQzXN",
termsURL: URL(string: "https://element.io/cookie-policy")!)
#else
/// The configuration to use for analytics. Set `isEnabled` to false to disable analytics.
static let analyticsConfiguration = AnalyticsConfiguration(isEnabled: BuildSettings.baseBundleIdentifier.starts(with: "im.vector.app"),
host: "https://posthog.hss.element.io",
apiKey: "phc_Jzsm6DTm6V2705zeU5dcNvQDlonOR68XvX2sh1sEOHO",
termsURL: URL(string: "https://element.io/cookie-policy")!)
#endif
// MARK: - Bug report
static let bugReportEndpointUrlString = ""
static let bugReportEndpointUrlString = "https://riot.im/bugreports"
// Use the name allocated by the bug report server
static let bugReportApplicationId = "riot-ios"
static let bugReportUISIId = "element-auto-uisi"
// MARK: - Integrations
static let integrationsUiUrlString = "https://scalar.vector.im/"
static let integrationsRestApiUrlString = "https://scalar.vector.im/api"
// Widgets in those paths require a scalar token
static let integrationsScalarWidgetsPaths = [""]
// Jitsi server used outside integrations to create conference calls from the call button in the timeline
static let jitsiServerUrl: URL = URL(string: "https://enter.jitsi.url")!
static let integrationsScalarWidgetsPaths = [
"https://scalar.vector.im/_matrix/integrations/v1",
"https://scalar.vector.im/api",
"https://scalar-staging.vector.im/_matrix/integrations/v1",
"https://scalar-staging.vector.im/api",
"https://scalar-staging.riot.im/scalar/api",
]
// Jitsi server used outside integrations to create conference calls from the call button in the timeline.
// Setting this to nil effectively disables Jitsi conference calls (given that there is no wellknown override).
// Note: this will not remove the conference call button, use roomScreenAllowVoIPForNonDirectRoom setting.
static let jitsiServerUrl: URL? = URL(string: "https://jitsi.riot.im")
// MARK: - Features
/// Setting to force protection by pin code
static let forcePinProtection: Bool = true
static let forcePinProtection: Bool = false
/// Max allowed time to continue using the app without prompting PIN
static let pinCodeGraceTimeInSeconds: TimeInterval = 180
static let pinCodeGraceTimeInSeconds: TimeInterval = 0
/// Force non-jailbroken app usage
static let forceNonJailbrokenUsage: Bool = true
static let allowSendingStickers: Bool = false
static let allowSendingStickers: Bool = true
static let allowLocalContactsAccess: Bool = false
static let allowInviteExernalUsers: Bool = false
static let allowLocalContactsAccess: Bool = true
static let enableSideMenu: Bool = false
static let sideMenuShowInviteFriends: Bool = false
static let allowInviteExernalUsers: Bool = true
static let allowBackgroundAudioMessagePlayback: Bool = true
// MARK: - Side Menu
static let enableSideMenu: Bool = true && !newAppLayoutEnabled
static let sideMenuShowInviteFriends: Bool = true
/// Whether to read the `io.element.functional_members` state event and exclude any service members when computing a room's name and avatar.
static let supportFunctionalMembers: Bool = true
@@ -220,32 +246,7 @@ final class BuildSettings: NSObject {
// MARK: - Feature Specifics
/// Not allowed pin codes. User won't be able to select one of the pin in the list.
static let notAllowedPINs: [String] = [
"1234",
"1111",
"0000",
"1212",
"7777",
"1004",
"2000",
"4444",
"2222",
"6969",
"9999",
"3333",
"5555",
"6666",
"1122",
"1313",
"8888",
"4321",
"2001",
"1010",
"2580",
"4711",
"0815",
"0852"
]
static let notAllowedPINs: [String] = []
/// Maximum number of allowed pin failures when unlocking, before force logging out the user. Defaults to `3`
static let maxAllowedNumberOfPinFailures: Int = 3
@@ -253,26 +254,16 @@ final class BuildSettings: NSObject {
/// Maximum number of allowed biometrics failures when unlocking, before fallbacking the user to the pin if set or logging out the user. Defaults to `5`
static let maxAllowedNumberOfBiometricsFailures: Int = 5
static let allowLocalContactPresence: Bool = false
/// Indicates should the app log out the user when number of PIN failures reaches `maxAllowedNumberOfPinFailures`. Defaults to `false`
static let logOutUserWhenPINFailuresExceeded: Bool = true
static let logOutUserWhenPINFailuresExceeded: Bool = false
/// Indicates should the app log out the user when number of biometrics failures reaches `maxAllowedNumberOfBiometricsFailures`. Defaults to `false`
static let logOutUserWhenBiometricsFailuresExceeded: Bool = true
static let logOutUserWhenBiometricsFailuresExceeded: Bool = false
/// If force is enabled the dialog for asking if reseting the key backup is not shown.. already asked before in mandatory verfication
static let forceResetBackupIfLost: Bool = true
/// if skip is enabled the key backup dialogs are passed through
static let skipKeyBackupStep: Bool = true
static let showNotificationsV2: Bool = true
// MARK: - Main Tabs
static let homeScreenShowHomeTab: Bool = false
static let homeScreenShowFavouritesTab: Bool = true
static let homeScreenShowPeopleTab: Bool = true
static let homeScreenShowRoomsTab: Bool = true
@@ -281,54 +272,34 @@ final class BuildSettings: NSObject {
static let settingsScreenShowUserFirstName: Bool = false
static let settingsScreenShowUserSurname: Bool = false
static let settingsScreenAllowAddingLinkedEmails: Bool = false
static let settingsScreenAllowAddingPhoneNumbers: Bool = false
static let settingsScreenAllowAddingEmailThreepids: Bool = false
static let settingsScreenAllowAddingPhoneThreepids: Bool = false
static let settingsScreenShowThreepidExplanatory: Bool = false
static let settingsScreenShowDiscoverySettings: Bool = false
static let settingsScreenAllowIdentityServerConfig: Bool = false
static let settingsScreenShowConfirmMediaSize: Bool = false
static let settingsScreenShowAdvancedSettings: Bool = false
static let settingsScreenShowLabSettings: Bool = false
static let settingsScreenAllowChangingRageshakeSettings: Bool = false
static let settingsScreenAllowChangingCrashUsageDataSettings: Bool = false
static let settingsScreenAllowBugReportingManually: Bool = false
static let settingsScreenAllowDeactivatingAccount: Bool = false
static let settingsScreenEnableDecodedContentAndGlobalSettings: Bool = false
static let settingsScreenAllowAddingEmailThreepids: Bool = true
static let settingsScreenAllowAddingPhoneThreepids: Bool = true
static let settingsScreenShowThreepidExplanatory: Bool = true
static let settingsScreenShowDiscoverySettings: Bool = true
static let settingsScreenAllowIdentityServerConfig: Bool = true
static let settingsScreenShowConfirmMediaSize: Bool = true
static let settingsScreenShowAdvancedSettings: Bool = true
static let settingsScreenShowLabSettings: Bool = true
static let settingsScreenAllowChangingRageshakeSettings: Bool = true
static let settingsScreenAllowChangingCrashUsageDataSettings: Bool = true
static let settingsScreenAllowBugReportingManually: Bool = true
static let settingsScreenAllowDeactivatingAccount: Bool = true
static let settingsScreenShowChangePassword:Bool = true
static let settingsScreenShowLinkPreviews:Bool = false
static let settingsScreenShowInviteFriends:Bool = false
static let settingsScreenShowSettings:Bool = true
static let settingsScreenShowFeedback:Bool = false
static let settingsScreenShowHelp:Bool = false
static let settingsScreenShowEnableStunServerFallback: Bool = true
static let settingsScreenShowNotificationDecodedContentOption: Bool = false
static let settingsScreenShowSystemSettingsOption: Bool = false
static let settingsScreenShowNsfwRoomsOption: Bool = false
static let settingsScreenShowTACSetting: Bool = false
static let settingsScreenShowSupportSetting: Bool = true
static let settingsScreenShowNotificationDecodedContentOption: Bool = true
static let settingsScreenShowNsfwRoomsOption: Bool = true
static let settingsSecurityScreenShowSessions:Bool = true
static let settingsSecurityScreenShowSetupBackup:Bool = true
static let settingsSecurityScreenShowRestoreBackup:Bool = true
static let settingsSecurityScreenShowDeleteBackup:Bool = true
static let settingsSecurityScreenShowCryptographyInfo:Bool = true
static let settingsSecurityScreenShowCryptographyExport:Bool = true
static let settingsSecurityScreenShowAdvancedUnverifiedDevices:Bool = true
/// A setting to enable the presence configuration settings section.
static let settingsScreenPresenceAllowConfiguration: Bool = false
static let settingsSecurityScreenShowCryptographyInfo:Bool = false
static let settingsSecurityScreenShowCryptographyExport:Bool = false
static let settingsSecurityScreenShowAdvancedUnverifiedDevices:Bool = false
// MARK: - Notification Settings
static let settingsNotificationsBWIDefaultSet:Bool = true
static let settingsNotificationsShowDefault:Bool = true
static let settingsNotificationsShowMentions:Bool = false
static let settingsNotificationsShowAdvanced:Bool = false
// MARK: - Timeline settings
static let roomInputToolbarCompressionMode: MediaCompressionMode = .none
static let roomInputToolbarCompressionMode: MediaCompressionMode = .prompt
enum MediaCompressionMode {
case prompt, small, medium, large, none
@@ -336,7 +307,7 @@ final class BuildSettings: NSObject {
// MARK: - Room Creation Screen
static let roomCreationScreenAllowEncryptionConfiguration: Bool = false
static let roomCreationScreenAllowEncryptionConfiguration: Bool = true
static let roomCreationScreenRoomIsEncrypted: Bool = true
static let roomCreationScreenAllowRoomTypeConfiguration: Bool = true
static let roomCreationScreenRoomIsPublic: Bool = false
@@ -347,7 +318,7 @@ final class BuildSettings: NSObject {
static let roomScreenAllowVoIPForNonDirectRoom: Bool = true
static let roomScreenAllowCameraAction: Bool = true
static let roomScreenAllowMediaLibraryAction: Bool = true
static let roomScreenAllowStickerAction: Bool = false
static let roomScreenAllowStickerAction: Bool = true
static let roomScreenAllowFilesAction: Bool = true
// Timeline style
@@ -366,186 +337,79 @@ final class BuildSettings: NSObject {
static let roomContextualMenuShowMoreOptionForMessages: Bool = true
static let roomContextualMenuShowMoreOptionForStates: Bool = true
static let roomContextualMenuShowReportContentOption: Bool = true
static let roomContextualMenuShowEncryptionOption: Bool = false
// MARK: - Room Info Screen
static let roomInfoScreenShowIntegrations: Bool = false
static let roomInfoScreenShowIntegrations: Bool = true
// MARK: - Room Settings Screen
static let roomSettingsScreenShowLowPriorityOption: Bool = false
static let roomSettingsScreenShowDirectChatOption: Bool = false
static let roomSettingsScreenAllowChangingAccessSettings: Bool = false
static let roomSettingsScreenAllowChangingHistorySettings: Bool = false
static let roomSettingsScreenShowAddressSettings: Bool = false
static let roomSettingsScreenShowAdvancedSettings: Bool = false
static let roomSettingsScreenShowAccessSettingsBW: Bool = true
static let roomSettingsScreenRemoveLeave: Bool = true
static let roomSettingsScreenShowLowPriorityOption: Bool = true
static let roomSettingsScreenShowDirectChatOption: Bool = true
static let roomSettingsScreenAllowChangingAccessSettings: Bool = true
static let roomSettingsScreenAllowChangingHistorySettings: Bool = true
static let roomSettingsScreenShowAddressSettings: Bool = true
static let roomSettingsScreenShowAdvancedSettings: Bool = true
static let roomSettingsScreenAdvancedShowEncryptToVerifiedOption: Bool = true
static let roomSettingsScreenShowNotificationsV2: Bool = false
// MARK: - Room Member Screen
static let roomMemberScreenShowIgnore: Bool = true
// MARK: - Message
static let messageDetailsAllowShare: Bool = false
static let messageDetailsAllowPermalink: Bool = false
static let messageDetailsAllowViewSource: Bool = false
static let messageDetailsAllowSave: Bool = false
static let messageDetailsAllowCopyMedia: Bool = false
static let messageDetailsAllowPasteMedia: Bool = false
static let messageDetailsAllowShare: Bool = true
static let messageDetailsAllowPermalink: Bool = true
static let messageDetailsAllowViewSource: Bool = true
static let messageDetailsAllowSave: Bool = true
static let messageDetailsAllowCopyMedia: Bool = true
static let messageDetailsAllowPasteMedia: Bool = true
// 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.
static let httpAdditionalHeaders: [String: String] = [:]
// MARK: - Authentication Screen
static let authScreenShowRegister = false
static let authScreenShowPhoneNumber = false
static let authScreenShowForgotPassword = false
static let authScreenShowRegister = true
static let authScreenShowPhoneNumber = true
static let authScreenShowForgotPassword = true
static let authScreenShowCustomServerOptions = true
static let authScreenShowTestServerOptions = true
static let authScreenShowSocialLoginSection = false
static let authScreenShowSocialLoginSection = true
// MARK: - Authentication Options
static let authEnableRefreshTokens = false
// MARK: - Cross-signing (bwi=true)
static let disableSelfUserVerification = true
// MARK: - Antivirus scan (bwi=true)
static let enableAntivirusScan = false
// MARK: - Room Screen
static let enableRoomSearchItem = false
// MARK: - Matomo Analytics (bwi=false)
static let enableMatomoAnalytics = false
// MARK: Verification screen (bwi=false)
static let showDetailedVerificationElements : Bool = false
static let showRecoverWithKey : Bool = false
// MARK: Unified search screen (bwi=false)
static let showUnifiedSearchViewMessagesTab : Bool = false
static let showUnifiedSearchViewFilesTab : Bool = false
// MARK: - Onboarding
static let onboardingShowAccountPersonalization = false
static let onboardingEnableNewAuthenticationFlow = false
static let onboardingShowAccountPersonalization = true
static let onboardingEnableNewAuthenticationFlow = true
// MARK: - Unified Search
static let unifiedSearchScreenShowPublicDirectory = true
// MARK: - Secrets Recovery
static let secretsRecoveryAllowReset = true
// MARK: VoIP support (bwi=false)
static let enableVoIPSupport : Bool = false
// MARK: - UISI Autoreporting
static let cryptoUISIAutoReportingEnabled = false
// MARK: - Polls
// MARK: Last message timestamp support (bwi=false)
static let enableLastMessageTimestamp : Bool = false
// MARK: Room chat alert screen (bwi=false)
static let enableViewEncryptionAction : Bool = false
// MARK: JavaScript support in WKWebView (bwi=false)
static let enableJSInWebView : Bool = false
// MARK: Secure pin code description (bwi=false)
static let settingsSettingsSecureShowPinCodeDescription : Bool = false
// MARK: Invite friends in Direct Chat (bwi=false)
static let directChatShowInviteFriends : Bool = false
// MARK: Last admin is not allowed to leave the room (bwi=true)
static let lastAdminIsNotAllowedToLeaveRoom : Bool = true
// MARK: Room Member Details Screen (bwi=true)
static let roomMemberDetailsHideLeaveButton : Bool = true
// MARK: Room create options (bwi=false)
static let enableShowInRoomDirectory : Bool = false
// MARK: sticker in composer (bwi=false)
static let enableRoomComposerSticker : Bool = false
// Mark: Unified Search (bwi=true)
static let unifiedSearchScreenShowPublicDirectory = true
// MARK: Allows removal of uploaded avatar photos (bwi=true)
static let enableRemoveAvatarImage = true
// MARK: Add a toggle button to the login screen to make the password visible
static let passwordIndicatorOnLogin : Bool = true
// MARK: Displays the element base version on the settings screen
static let elementBaseVersion : String = "1.9.8"
static let showElementBaseVersion : Bool = true
// MARK: Bypasses the normal forgot password process by presenting the user an information alert
// (requires authScreenShowForgotPassword set to true)
static let forgotPasswordInformationAlert : Bool = true
// MARK: Promote new feature within a banner below the navigation view
static let showTopBanner : Bool = true
static let showCustomServerDisplayName : Bool = true
static let customServerDisplayName : String = ""
// MARK BWI show/hide developer menu
static let bwiShowDeveloperSettings : Bool = false
// MARK BWI personal notes room
static let bwiPersonalNotesRoom : Bool = false
static let bwiPersonalNotesRoomLeavable : Bool = false
static let bwiResetPersonalNotesAccountData : Bool = false
static let bwiShowTimelineSettings : Bool = false
// MARK BWI personal state
static let bwiPersonalState : Bool = false
// MARK BWI personal notes room
static let bwiRollsAndRights : Bool = true
// MARK: Timeline
static let settingsScreenShowSimpleTimeLineOptions : Bool = false
static let settingsScreenShowTimeStampOption : Bool = true
static let settingsScreenShowDeletedMessagesOption : Bool = false
static let settingsScreenShowNameChangeOption : Bool = false
static let settingsScreenShowChatEffectsOption : Bool = false
static let settingsScreenShowRoomAvatarChangeOption : Bool = false
static let settingsScreenShowUserAvatarChangeOption : Bool = true
static let settingsScreenShowEnterRoomOption : Bool = true
static let bwiLastAdminCanDowngradeHimself : Bool = false
static let bwiEnableErrorTracking : Bool = false
static let bwiEnableRegisterInfo : Bool = false
static let bwiShowHappyBirthdayCampaign: Bool = false
static let bwiHappyBirthdayCampaignIdentifier: String = "one_year_anniversary"
static let bwiDisableSecuritySettingsUntrustedDevices: Bool = true
static let bwiShowMatomoInfoScreen = false
static let bwiShowMatomoSettings = false
static let bwiMatomoTrackingDefaultState = false
static let bwiShowNewFeatures = true
static let bwiSendMessageThreshold = 10.0
static let pollsEnabled = true
// MARK: - Location Sharing
/// Overwritten by the home server's .well-known configuration (if any exists)
static let defaultTileServerMapStyleURL = URL(string: "https://msgpriv.example.com/")!
static let defaultTileServerMapStyleURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx")!
static let locationSharingEnabled = true
// MARK: - Voice Broadcast
static let voiceBroadcastChunkLength: Int = 120
static let voiceBroadcastMaxLength: UInt64 = 144000
// MARK: - MXKAppSettings
static let enableBotCreation: Bool = false
@@ -561,12 +425,16 @@ final class BuildSettings: NSObject {
static let syncLocalContacts: Bool = false
// MARK: - New App Layout
static let newAppLayoutEnabled = false
// MARK: - Device manager
static let newAppLayoutEnabled = true
// MARK: - QR Login
static let deviceManagerEnabled = false
/// Flag indicating whether the QR login enabled from login screen
static let qrLoginEnabledFromNotAuthenticated = true
/// Flag indicating whether the QR login enabled from Device Manager screen
static let qrLoginEnabledFromAuthenticated = false
/// Flag indicating whether displaying QRs enabled for the QR login screens
static let qrLoginEnableDisplayingQRs = false
// MARK: - Message Bubbles bwi show in our menu and only for beta builds
static let bwiShowMessageBubbles = false
static let rendezvousServerBaseURL = URL(string: "https://rendezvous.lab.element.dev/")!
}
-70
View File
@@ -1,70 +0,0 @@
/*
* Copyright (c) 2021 BWI GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Foundation
import MatrixSDK
import KeychainAccess
@objcMembers
final class BwiSettings : NSObject {
static let shared = BwiSettings()
private enum UserDefaultsKeys {
static let additionalBwiHeaderKey = "bwiHeader"
}
private struct BwiSettingsConstants {
static let bwiSettingsKeychainService: String = BuildSettings.baseBundleIdentifier + ".bwi-settings-service"
}
private let vault: KeyValueVault
override init() {
vault = KeychainVault(Keychain(service: BwiSettingsConstants.bwiSettingsKeychainService,
accessGroup: BuildSettings.keychainAccessGroup))
super.init()
}
func reset() {
additionalBwiHeader = UserAgentService().bwiUserAgentDict
let sdkOptions = MXSDKOptions.sharedInstance()
sdkOptions.httpAdditionalHeaders = UserAgentService().bwiUserAgentDict
}
// MARK: Servers
var additionalBwiHeader: Dictionary<String, String> {
get {
do {
guard let data = try vault.data(forKey: UserDefaultsKeys.additionalBwiHeaderKey) else {
return UserAgentService().bwiUserAgentDict
}
var dict = try JSONDecoder().decode(Dictionary<String,String>.self, from: data)
dict["User-Agent"] = UserAgentService().bwiUserAgent
return dict
} catch {
return UserAgentService().bwiUserAgentDict
}
} set {
do {
let data = try JSONEncoder().encode(newValue)
try vault.set(data, forKey: UserDefaultsKeys.additionalBwiHeaderKey)
} catch let error {
NSLog("[PinCodePreferences] Error when storing addional header to the vault: \(error)")
}
}
}
}
+6 -6
View File
@@ -46,15 +46,15 @@ class CommonConfiguration: NSObject, Configurable {
// Customize the default notification content
settings.notificationBodyLocalizationKey = "Notification"
settings.messageDetailsAllowSharing = BuildSettings.messageDetailsAllowShare
settings.messageDetailsAllowSaving = BuildSettings.messageDetailsAllowSave
settings.messageDetailsAllowCopyingMedia = BuildSettings.messageDetailsAllowCopyMedia
settings.messageDetailsAllowPastingMedia = BuildSettings.messageDetailsAllowPasteMedia
settings.messageDetailsAllowSharing = BWIBuildSettings.shared.messageDetailsAllowShare
settings.messageDetailsAllowSaving = BWIBuildSettings.shared.messageDetailsAllowSave
settings.messageDetailsAllowCopyingMedia = BWIBuildSettings.shared.messageDetailsAllowCopyMedia
settings.messageDetailsAllowPastingMedia = BWIBuildSettings.shared.messageDetailsAllowPasteMedia
// Enable link detection if url preview are enabled
settings.enableBubbleComponentLinkDetection = true
MXKContactManager.shared().allowLocalContactsAccess = BuildSettings.allowLocalContactsAccess
MXKContactManager.shared().allowLocalContactsAccess = BWIBuildSettings.shared.allowLocalContactsAccess
}
private func setupMatrixSDKSettings() {
@@ -162,7 +162,7 @@ class CommonConfiguration: NSObject, Configurable {
// Let's call invite be valid for 1 minute
callManager.inviteLifetime = 60000
if RiotSettings.shared.allowStunServerFallback, let stunServerFallback = BuildSettings.stunServerFallbackUrlString {
if RiotSettings.shared.allowStunServerFallback, let stunServerFallback = BWIBuildSettings.shared.stunServerFallbackUrlString {
callManager.fallbackSTUNServer = stunServerFallback
}
}
@@ -9,6 +9,15 @@
"version" : "4.7.0"
}
},
{
"identity" : "lottie-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-ios.git",
"state" : {
"revision" : "b4bd0604ded9574807f41b4004b57dd1226a30a4",
"version" : "3.5.0"
}
},
{
"identity" : "maplibre-gl-native-distribution",
"kind" : "remoteSourceControl",
@@ -21,7 +21,7 @@ import GBDeviceInfo
extension MXBugReportRestClient {
@objc static func vc_bugReportRestClient(appName: String) -> MXBugReportRestClient {
let client = MXBugReportRestClient(bugReportEndpoint: BuildSettings.bugReportEndpointUrlString)
let client = MXBugReportRestClient(bugReportEndpoint: BWIBuildSettings.shared.bugReportEndpointUrlString)
// App info
client.appName = appName
client.version = AppDelegate.theDelegate().appVersion
@@ -40,7 +40,7 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate {
private let vault: KeyValueVault
private override init() {
vault = BwiBuildSettings.forcedPinProtection ? securedFileStore : keychainVault
vault = BWIBuildSettings.shared.forcedPinProtection ? securedFileStore : keychainVault
}
func initKeys() {
@@ -58,7 +58,7 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate {
assert(keychainVault.objectExists(withKey: EncryptionKeyManager.roomLastMessageIv), "[EncryptionKeyManager] initKeys: Failed to generate IV for room last message")
assert(keychainVault.objectExists(withKey: EncryptionKeyManager.roomLastMessageAesKey), "[EncryptionKeyManager] initKeys: Failed to generate AES Key for room last message encryption")
guard !BwiBuildSettings.forcedPinProtection || !SecureFileStorage.shared.locked else {
guard !BWIBuildSettings.shared.forcedPinProtection || !SecureFileStorage.shared.locked else {
MXLog.debug("[EncryptionKeyManager] initKeys: cannot init keys as store is not ready")
return
}
@@ -72,10 +72,10 @@ class LocalAuthenticationService: NSObject {
}
func shouldLogOutUser() -> Bool {
if BuildSettings.logOutUserWhenPINFailuresExceeded && pinCodePreferences.numberOfPinFailures >= pinCodePreferences.maxAllowedNumberOfPinFailures {
if BWIBuildSettings.shared.logOutUserWhenPINFailuresExceeded && pinCodePreferences.numberOfPinFailures >= pinCodePreferences.maxAllowedNumberOfPinFailures {
return true
}
if BuildSettings.logOutUserWhenBiometricsFailuresExceeded && pinCodePreferences.numberOfBiometricsFailures >= pinCodePreferences.maxAllowedNumberOfBiometricsFailures {
if BWIBuildSettings.shared.logOutUserWhenBiometricsFailuresExceeded && pinCodePreferences.numberOfBiometricsFailures >= pinCodePreferences.maxAllowedNumberOfBiometricsFailures {
return true
}
return false
@@ -43,7 +43,7 @@ Matrix session observer used to detect new opened sessions.
if (self = [super init])
{
self.pushNotificationStore = pushNotificationStore;
if (BuildSettings.allowVoIPUsage)
if (BWIBuildSettings.shared.allowVoIPUsage)
{
_pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()];
}
@@ -40,7 +40,7 @@ extension RiotSettings {
var settingsScreenShowSimpleTimeLineOptions: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowSimpleTimeLineOptions) != nil else {
return BuildSettings.settingsScreenShowSimpleTimeLineOptions
return BWIBuildSettings.shared.settingsScreenShowSimpleTimeLineOptions
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowSimpleTimeLineOptions)
} set {
@@ -51,7 +51,7 @@ extension RiotSettings {
var settingsScreenShowTimeStampOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowTimeStampOption) != nil else {
return BuildSettings.settingsScreenShowTimeStampOption
return BWIBuildSettings.shared.settingsScreenShowTimeStampOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowTimeStampOption)
} set {
@@ -62,7 +62,7 @@ extension RiotSettings {
var settingsScreenShowDeletedMessagesOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowDeletedMessagesOption) != nil else {
return BuildSettings.settingsScreenShowDeletedMessagesOption
return BWIBuildSettings.shared.settingsScreenShowDeletedMessagesOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowDeletedMessagesOption)
} set {
@@ -73,7 +73,7 @@ extension RiotSettings {
var settingsScreenShowNameChangeOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowNameChangeOption) != nil else {
return BuildSettings.settingsScreenShowNameChangeOption
return BWIBuildSettings.shared.settingsScreenShowNameChangeOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowNameChangeOption)
} set {
@@ -84,7 +84,7 @@ extension RiotSettings {
var settingsScreenShowChatEffectsOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowChatEffectsOption) != nil else {
return BuildSettings.settingsScreenShowChatEffectsOption
return BWIBuildSettings.shared.settingsScreenShowChatEffectsOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowChatEffectsOption)
} set {
@@ -95,7 +95,7 @@ extension RiotSettings {
var settingsScreenShowRoomAvatarChangeOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowRoomAvatarChangeOption) != nil else {
return BuildSettings.settingsScreenShowRoomAvatarChangeOption
return BWIBuildSettings.shared.settingsScreenShowRoomAvatarChangeOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowRoomAvatarChangeOption)
} set {
@@ -106,7 +106,7 @@ extension RiotSettings {
var settingsScreenShowUserAvatarChangeOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowUserAvatarChangeOption) != nil else {
return BuildSettings.settingsScreenShowUserAvatarChangeOption
return BWIBuildSettings.shared.settingsScreenShowUserAvatarChangeOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowUserAvatarChangeOption)
} set {
@@ -117,7 +117,7 @@ extension RiotSettings {
var settingsScreenShowEnterRoomOption: Bool {
get {
guard RiotSettings.defaults.object(forKey: UserDefaultsTimelineKeys.settingsScreenShowEnterRoomOption) != nil else {
return BuildSettings.settingsScreenShowEnterRoomOption
return BWIBuildSettings.shared.settingsScreenShowEnterRoomOption
}
return RiotSettings.defaults.bool(forKey: UserDefaultsTimelineKeys.settingsScreenShowEnterRoomOption)
} set {
+29 -28
View File
@@ -78,10 +78,10 @@ final class RiotSettings: NSObject {
// MARK: Servers
@UserDefault(key: "homeserverurl", defaultValue: BuildSettings.serverConfigDefaultHomeserverUrlString, storage: defaults)
@UserDefault(key: "homeserverurl", defaultValue: BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString, storage: defaults)
var homeserverUrlString
@UserDefault(key: "identityserverurl", defaultValue: BuildSettings.serverConfigDefaultIdentityServerUrlString, storage: defaults)
@UserDefault(key: "identityserverurl", defaultValue: BWIBuildSettings.shared.serverConfigDefaultIdentityServerUrlString, storage: defaults)
var identityServerUrlString
// MARK: Notifications
@@ -243,7 +243,7 @@ final class RiotSettings: NSObject {
@UserDefault(key: "roomScreenAllowMediaLibraryAction", defaultValue: BuildSettings.roomScreenAllowMediaLibraryAction, storage: defaults)
var roomScreenAllowMediaLibraryAction
@UserDefault(key: "roomScreenAllowStickerAction", defaultValue: BuildSettings.roomScreenAllowStickerAction, storage: defaults)
@UserDefault(key: "roomScreenAllowStickerAction", defaultValue: BWIBuildSettings.shared.roomScreenAllowStickerAction, storage: defaults)
var roomScreenAllowStickerAction
@UserDefault(key: "roomScreenAllowFilesAction", defaultValue: BuildSettings.roomScreenAllowFilesAction, storage: defaults)
@@ -287,7 +287,7 @@ final class RiotSettings: NSObject {
// MARK: - Room Info Screen
@UserDefault(key: "roomInfoScreenShowIntegrations", defaultValue: BuildSettings.roomInfoScreenShowIntegrations, storage: defaults)
@UserDefault(key: "roomInfoScreenShowIntegrations", defaultValue: BWIBuildSettings.shared.roomInfoScreenShowIntegrations, storage: defaults)
var roomInfoScreenShowIntegrations
// MARK: - Room Member Screen
@@ -297,7 +297,7 @@ final class RiotSettings: NSObject {
// MARK: - Room Creation Screen
@UserDefault(key: "roomCreationScreenAllowEncryptionConfiguration", defaultValue: BuildSettings.roomCreationScreenAllowEncryptionConfiguration, storage: defaults)
@UserDefault(key: "roomCreationScreenAllowEncryptionConfiguration", defaultValue: BWIBuildSettings.shared.roomCreationScreenAllowEncryptionConfiguration, storage: defaults)
var roomCreationScreenAllowEncryptionConfiguration
@UserDefault(key: "roomCreationScreenRoomIsEncrypted", defaultValue: BuildSettings.roomCreationScreenRoomIsEncrypted, storage: defaults)
@@ -311,7 +311,7 @@ final class RiotSettings: NSObject {
// MARK: Features
@UserDefault(key: "allowInviteExernalUsers", defaultValue: BuildSettings.allowInviteExernalUsers, storage: defaults)
@UserDefault(key: "allowInviteExernalUsers", defaultValue: BWIBuildSettings.shared.allowInviteExernalUsers, storage: defaults)
var allowInviteExernalUsers
/// When set to false the original image is sent and a 1080p preset is used for videos.
@@ -322,7 +322,7 @@ final class RiotSettings: NSObject {
// MARK: - Main Tabs
// bwi: hide home tab
@UserDefault(key: "homeScreenShowHomeTab", defaultValue: BuildSettings.homeScreenShowHomeTab, storage: defaults)
@UserDefault(key: "homeScreenShowHomeTab", defaultValue: BWIBuildSettings.shared.homeScreenShowHomeTab, storage: defaults)
var homeScreenShowHomeTab
@UserDefault(key: "homeScreenShowFavouritesTab", defaultValue: BuildSettings.homeScreenShowFavouritesTab, storage: defaults)
@@ -336,22 +336,22 @@ final class RiotSettings: NSObject {
// MARK bwi Left Settings
@UserDefault(key: "settingsScreenShowInviteFriends", defaultValue: BuildSettings.settingsScreenShowInviteFriends, storage: defaults)
@UserDefault(key: "settingsScreenShowInviteFriends", defaultValue: BWIBuildSettings.shared.settingsScreenShowInviteFriends, storage: defaults)
var settingsScreenShowInviteFriends
@UserDefault(key: "settingsScreenShowSettings", defaultValue: BuildSettings.settingsScreenShowSettings, storage: defaults)
@UserDefault(key: "settingsScreenShowSettings", defaultValue: BWIBuildSettings.shared.settingsScreenShowSettings, storage: defaults)
var settingsScreenShowSettings
@UserDefault(key: "settingsScreenShowFeedback", defaultValue: BuildSettings.settingsScreenShowFeedback, storage: defaults)
@UserDefault(key: "settingsScreenShowFeedback", defaultValue: BWIBuildSettings.shared.settingsScreenShowFeedback, storage: defaults)
var settingsScreenShowFeedback
@UserDefault(key: "settingsScreenShowHelp", defaultValue: BuildSettings.settingsScreenShowHelp, storage: defaults)
@UserDefault(key: "settingsScreenShowHelp", defaultValue: BWIBuildSettings.shared.settingsScreenShowHelp, storage: defaults)
var settingsScreenShowHelp
@UserDefault(key: "settingsScreenShowSystemSettingsOption", defaultValue: BuildSettings.settingsScreenShowSystemSettingsOption, storage: defaults)
@UserDefault(key: "settingsScreenShowSystemSettingsOption", defaultValue: BWIBuildSettings.shared.settingsScreenShowSystemSettingsOption, storage: defaults)
var settingsScreenShowSystemSettingsOption
@UserDefault(key: "homeScreenShowHomeTab", defaultValue: BuildSettings.bwiMatomoTrackingDefaultState, storage: defaults)
@UserDefault(key: "homeScreenShowHomeTab", defaultValue: BWIBuildSettings.shared.bwiMatomoTrackingDefaultState, storage: defaults)
var bwiEnableMatomoTracking
// MARK: General Settings
@@ -362,10 +362,10 @@ final class RiotSettings: NSObject {
@UserDefault(key: "settingsScreenShowEnableStunServerFallback", defaultValue: BuildSettings.settingsScreenShowEnableStunServerFallback, storage: defaults)
var settingsScreenShowEnableStunServerFallback
@UserDefault(key: "settingsScreenShowNotificationDecodedContentOption", defaultValue: BuildSettings.settingsScreenShowNotificationDecodedContentOption, storage: defaults)
@UserDefault(key: "settingsScreenShowNotificationDecodedContentOption", defaultValue: BWIBuildSettings.shared.settingsScreenShowNotificationDecodedContentOption, storage: defaults)
var settingsScreenShowNotificationDecodedContentOption
@UserDefault(key: "settingsScreenShowNsfwRoomsOption", defaultValue: BuildSettings.settingsScreenShowNsfwRoomsOption, storage: defaults)
@UserDefault(key: "settingsScreenShowNsfwRoomsOption", defaultValue: BWIBuildSettings.shared.settingsScreenShowNsfwRoomsOption, storage: defaults)
var settingsScreenShowNsfwRoomsOption
@UserDefault(key: "settingsSecurityScreenShowSessions", defaultValue: BuildSettings.settingsSecurityScreenShowSessions, storage: defaults)
@@ -380,42 +380,42 @@ final class RiotSettings: NSObject {
@UserDefault(key: "settingsSecurityScreenShowDeleteBackup", defaultValue: BuildSettings.settingsSecurityScreenShowDeleteBackup, storage: defaults)
var settingsSecurityScreenShowDeleteBackup
@UserDefault(key: "settingsSecurityScreenShowCryptographyInfo", defaultValue: BuildSettings.settingsSecurityScreenShowCryptographyInfo, storage: defaults)
@UserDefault(key: "settingsSecurityScreenShowCryptographyInfo", defaultValue: BWIBuildSettings.shared.settingsSecurityScreenShowCryptographyInfo, storage: defaults)
var settingsSecurityScreenShowCryptographyInfo
@UserDefault(key: "settingsSecurityScreenShowCryptographyExport", defaultValue: BuildSettings.settingsSecurityScreenShowCryptographyExport, storage: defaults)
@UserDefault(key: "settingsSecurityScreenShowCryptographyExport", defaultValue: BWIBuildSettings.shared.settingsSecurityScreenShowCryptographyExport, storage: defaults)
var settingsSecurityScreenShowCryptographyExport
@UserDefault(key: "settingsSecurityScreenShowAdvancedBlacklistUnverifiedDevices", defaultValue: BuildSettings.settingsSecurityScreenShowAdvancedUnverifiedDevices, storage: defaults)
@UserDefault(key: "settingsSecurityScreenShowAdvancedBlacklistUnverifiedDevices", defaultValue: BWIBuildSettings.shared.settingsSecurityScreenShowAdvancedUnverifiedDevices, storage: defaults)
var settingsSecurityScreenShowAdvancedUnverifiedDevices
@UserDefault(key: "settingsNotificationsShowDefault", defaultValue: BuildSettings.settingsNotificationsShowDefault, storage: defaults)
@UserDefault(key: "settingsNotificationsShowDefault", defaultValue: BWIBuildSettings.shared.settingsNotificationsShowDefault, storage: defaults)
var settingsNotificationsShowDefault
@UserDefault(key: "settingsNotificationsShowMentions", defaultValue: BuildSettings.settingsNotificationsShowMentions, storage: defaults)
@UserDefault(key: "settingsNotificationsShowMentions", defaultValue: BWIBuildSettings.shared.settingsNotificationsShowMentions, storage: defaults)
var settingsNotificationsShowMentions
@UserDefault(key: "settingsNotificationsShowAdvanced", defaultValue: BuildSettings.settingsNotificationsShowAdvanced, storage: defaults)
@UserDefault(key: "settingsNotificationsShowAdvanced", defaultValue: BWIBuildSettings.shared.settingsNotificationsShowAdvanced, storage: defaults)
var settingsNotificationsShowAdvanced
// MARK: - Room Settings Screen
@UserDefault(key: "roomSettingsScreenShowLowPriorityOption", defaultValue: BuildSettings.roomSettingsScreenShowLowPriorityOption, storage: defaults)
@UserDefault(key: "roomSettingsScreenShowLowPriorityOption", defaultValue: BWIBuildSettings.shared.roomSettingsScreenShowLowPriorityOption, storage: defaults)
var roomSettingsScreenShowLowPriorityOption
@UserDefault(key: "roomSettingsScreenShowDirectChatOption", defaultValue: BuildSettings.roomSettingsScreenShowDirectChatOption, storage: defaults)
@UserDefault(key: "roomSettingsScreenShowDirectChatOption", defaultValue: BWIBuildSettings.shared.roomSettingsScreenShowDirectChatOption, storage: defaults)
var roomSettingsScreenShowDirectChatOption
@UserDefault(key: "roomSettingsScreenAllowChangingAccessSettings", defaultValue: BuildSettings.roomSettingsScreenAllowChangingAccessSettings, storage: defaults)
@UserDefault(key: "roomSettingsScreenAllowChangingAccessSettings", defaultValue: BWIBuildSettings.shared.roomSettingsScreenAllowChangingAccessSettings, storage: defaults)
var roomSettingsScreenAllowChangingAccessSettings
@UserDefault(key: "roomSettingsScreenAllowChangingHistorySettings", defaultValue: BuildSettings.roomSettingsScreenAllowChangingHistorySettings, storage: defaults)
@UserDefault(key: "roomSettingsScreenAllowChangingHistorySettings", defaultValue: BWIBuildSettings.shared.roomSettingsScreenAllowChangingHistorySettings, storage: defaults)
var roomSettingsScreenAllowChangingHistorySettings
@UserDefault(key: "roomSettingsScreenShowAddressSettings", defaultValue: BuildSettings.roomSettingsScreenShowAddressSettings, storage: defaults)
@UserDefault(key: "roomSettingsScreenShowAddressSettings", defaultValue: BWIBuildSettings.shared.roomSettingsScreenShowAddressSettings, storage: defaults)
var roomSettingsScreenShowAddressSettings
@UserDefault(key: "roomSettingsScreenShowAdvancedSettings", defaultValue: BuildSettings.roomSettingsScreenShowAdvancedSettings, storage: defaults)
@UserDefault(key: "roomSettingsScreenShowAdvancedSettings", defaultValue: BWIBuildSettings.shared.roomSettingsScreenShowAdvancedSettings, storage: defaults)
var roomSettingsScreenShowAdvancedSettings
@UserDefault(key: "roomSettingsScreenAdvancedShowEncryptToVerifiedOption", defaultValue: BuildSettings.roomSettingsScreenAdvancedShowEncryptToVerifiedOption, storage: defaults)
@@ -423,7 +423,8 @@ final class RiotSettings: NSObject {
// MARK: - Unified Search
@UserDefault(key: "unifiedSearchScreenShowPublicDirectory", defaultValue: BuildSettings.unifiedSearchScreenShowPublicDirectory, storage: defaults)
@UserDefault(key: "unifiedSearchScreenShowPublicDirectory", defaultValue: BWIBuildSettings
.shared.unifiedSearchScreenShowPublicDirectory, storage: defaults)
var unifiedSearchScreenShowPublicDirectory
// MARK: - Secrets Recovery
+1 -1
View File
@@ -719,7 +719,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
BOOL isScalarUrl = NO;
// TODO: Do we need to add `integrationsWidgetsUrls` to `WidgetManagerConfig`?
NSArray<NSString*> *scalarUrlStrings = BuildSettings.integrationsScalarWidgetsPaths;
NSArray<NSString*> *scalarUrlStrings = BWIBuildSettings.shared.integrationsScalarWidgetsPaths;
if (scalarUrlStrings.count == 0)
{
NSString *apiUrl = [self configForUser:userId].apiUrl;
@@ -59,7 +59,7 @@ final class HomeserverConfigurationBuilder: NSObject {
// Jitsi configuration
let jitsiPreferredDomain: String?
let jitsiServerURL: URL?
let hardcodedJitsiServerURL: URL? = BuildSettings.jitsiServerUrl
let hardcodedJitsiServerURL: URL? = BWIBuildSettings.shared.jitsiServerUrl
if let preferredDomain = vectorWellKnownJitsiConfiguration?.preferredDomain {
jitsiPreferredDomain = preferredDomain
@@ -76,7 +76,7 @@ final class HomeserverConfigurationBuilder: NSObject {
let mapStyleURL = URL(string: mapStyleURLString) {
tileServerMapStyleURL = mapStyleURL
} else {
tileServerMapStyleURL = BuildSettings.defaultTileServerMapStyleURL
tileServerMapStyleURL = BWIBuildSettings.shared.defaultTileServerMapStyleURL
}
let tileServerConfiguration = HomeserverTileServerConfiguration(mapStyleURL: tileServerMapStyleURL)
+1 -1
View File
@@ -60,7 +60,7 @@ import AnalyticsEvents
/// Whether to show the user the analytics opt in prompt.
var shouldShowAnalyticsPrompt: Bool {
// Only show the prompt once, and when analytics are enabled in BuildSettings.
!RiotSettings.shared.hasSeenAnalyticsPrompt && BuildSettings.analyticsConfiguration.isEnabled
!RiotSettings.shared.hasSeenAnalyticsPrompt && BWIBuildSettings.shared.analyticsConfiguration.isEnabled
}
/// Indicates whether the user previously accepted Matomo analytics and should be shown the upgrade prompt.
@@ -18,7 +18,7 @@ import PostHog
extension PHGPostHogConfiguration {
static var standard: PHGPostHogConfiguration? {
let analyticsConfiguration = BuildSettings.analyticsConfiguration
let analyticsConfiguration = BWIBuildSettings.shared.analyticsConfiguration
guard analyticsConfiguration.isEnabled else { return nil }
let postHogConfiguration = PHGPostHogConfiguration(apiKey: analyticsConfiguration.apiKey, host: analyticsConfiguration.host)
@@ -92,7 +92,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
// Setup user location services
_ = UserLocationServiceProvider.shared
if BuildSettings.enableSideMenu {
if BWIBuildSettings.shared.enableSideMenu {
self.addSideMenu()
}
@@ -164,7 +164,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
}
@objc private func newAppLayoutToggleDidChange(notification: Notification) {
if BuildSettings.enableSideMenu {
if BWIBuildSettings.shared.enableSideMenu {
self.addSideMenu()
}
}
+7 -7
View File
@@ -487,7 +487,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
#ifdef CALL_STACK_JINGLE
// Setup Jitsi
NSURL *jitsiServerUrl = BuildSettings.jitsiServerUrl;
NSURL *jitsiServerUrl = BWIBuildSettings.shared.jitsiServerUrl;
if (jitsiServerUrl)
{
[JitsiService.shared configureDefaultConferenceOptionsWith:jitsiServerUrl];
@@ -654,7 +654,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[self.setPinCoordinatorBridgePresenter presentWithMainAppWindow:self.window];
}
}
else if (BwiBuildSettings.forcedPinProtection)
else if (BWIBuildSettings.shared.forcedPinProtection)
{
if (self.setPinCoordinatorBridgePresenter.viewMode == SetPinCoordinatorViewModeInactive)
{
@@ -2190,7 +2190,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
if (isLoggedOut)
{
//[RiotSettings.shared reset];
[BwiSettings.shared reset];
[BWIBuildSettings.shared reset];
[BWIAnalytics.sharedTracker trackEvent:@"Session" action:@"Logout"];
}
@@ -2199,7 +2199,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
}];
// bwi reset outdated Alert for next login
if (BwiBuildSettings.bwiCheckAppVersion) {
if (BWIBuildSettings.shared.bwiCheckAppVersion) {
ValidAppVersionsDefaultService *service = [[ValidAppVersionsDefaultService alloc] init];
[service setOutdatedAlertShown:false];
}
@@ -2268,7 +2268,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
if (isLoggedOut)
{
//[RiotSettings.shared reset];
[BwiSettings.shared reset];
[BWIBuildSettings.shared reset];
[BWIAnalytics.sharedTracker trackEvent:@"Session" action:@"Logout"];
}
@@ -3214,7 +3214,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
{
[_errorNotification dismissViewControllerAnimated:NO completion:nil];
NSString *stunFallbackHost = BuildSettings.stunServerFallbackUrlString;
NSString *stunFallbackHost = BWIBuildSettings.shared.stunServerFallbackUrlString;
// Remove "stun:"
stunFallbackHost = [stunFallbackHost componentsSeparatedByString:@":"].lastObject;
@@ -3234,7 +3234,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
handler:^(UIAlertAction * action) {
RiotSettings.shared.allowStunServerFallback = YES;
mainSession.callManager.fallbackSTUNServer = BuildSettings.stunServerFallbackUrlString;
mainSession.callManager.fallbackSTUNServer = BWIBuildSettings.shared.stunServerFallbackUrlString;
[AppDelegate theDelegate].errorNotification = nil;
}]];
@@ -173,20 +173,20 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
[self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateNormal];
[self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateHighlighted];
if (!BuildSettings.authScreenShowRegister || !BwiBuildSettings.bwiAuthentificationScreenEnableRegister)
if (!BWIBuildSettings.shared.authScreenShowRegister || !BWIBuildSettings.shared.bwiAuthentificationScreenEnableRegister)
{
self.navigationItem.rightBarButtonItem.enabled = NO;
self.navigationItem.rightBarButtonItem.title = nil;
}
self.serverOptionsContainer.hidden = !BuildSettings.authScreenShowCustomServerOptions;
self.serverOptionsContainer.hidden = !BWIBuildSettings.shared.authScreenShowCustomServerOptions;
[self setCustomServerFieldsVisible:NO];
if( BuildSettings.authScreenShowTestServerOptions ) {
if( BWIBuildSettings.shared.authScreenShowTestServerOptions ) {
[self enableTestServerControl];
}
if( BuildSettings.bwiEnableRegisterInfo ) {
if( BWIBuildSettings.shared.bwiEnableRegisterInfo ) {
[self enableRegisterButton];
}
@@ -251,9 +251,9 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
_keyboardAvoider = [[KeyboardAvoider alloc] initWithScrollViewContainerView:self.view scrollView:self.authenticationScrollView];
[BwiSettings.shared reset];
[BWIBuildSettings.shared reset];
if (BwiBuildSettings.bwiEnableBuMAuthentificationUI) {
if (BWIBuildSettings.shared.bwiEnableBuMAuthentificationUI) {
[self bwiUpdateUIForBuM];
}
}
@@ -264,7 +264,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
UITextField *passwordTextField = [authInputsView passWordTextField];
[passwordTextField setSecureTextEntry:TRUE];
if (BuildSettings.passwordIndicatorOnLogin)
if (BWIBuildSettings.shared.passwordIndicatorOnLogin)
{
[authInputsView.passwordVisibilityToggleButton setTintColor: ThemeService.shared.theme.tintColor];
[authInputsView.passwordVisibilityToggleButton addTarget:self action:@selector(onPasswordVisibilityToggleButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
@@ -564,7 +564,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
if ((self.authType == MXKAuthenticationTypeLogin)
&& self.currentLoginSSOFlow
&& !self.isAuthSessionContainsPasswordFlow
&& BuildSettings.authScreenShowSocialLoginSection)
&& BWIBuildSettings.shared.authScreenShowSocialLoginSection)
{
hideAuthInputView = YES;
}
@@ -613,8 +613,8 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
{
if (!authInputsview.isSingleSignOnRequired
&& !self.softLogoutCredentials
&& BuildSettings.authScreenShowRegister
&& BwiBuildSettings.bwiAuthentificationScreenEnableRegister)
&& BWIBuildSettings.shared.authScreenShowRegister
&& BWIBuildSettings.shared.bwiAuthentificationScreenEnableRegister)
{
self.navigationItem.rightBarButtonItem.title = [VectorL10n authRegister];
}
@@ -941,7 +941,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
}
else if (sender == self.forgotPasswordButton)
{
if( [BuildSettings forgotPasswordInformationAlert] ) {
if( [BWIBuildSettings.shared forgotPasswordInformationAlert] ) {
[self presentForgotPasswordInformationAlert];
}
else if (!self.isIdentityServerConfigured)
@@ -1149,7 +1149,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
BOOL showForgotPasswordButton = NO;
if (BuildSettings.authScreenShowForgotPassword && authInputsview.isHidden == NO)
if (BWIBuildSettings.shared.authScreenShowForgotPassword && authInputsview.isHidden == NO)
{
showForgotPasswordButton = (self.authType == MXKAuthenticationTypeLogin) && !authInputsview.isSingleSignOnRequired;
}
@@ -1209,7 +1209,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
}
self.serverOptionsContainer.hidden = !thirdPartyIdentifiersHidden
|| !BuildSettings.authScreenShowCustomServerOptions;
|| !BWIBuildSettings.shared.authScreenShowCustomServerOptions;
[self refreshContentViewHeightConstraint];
if (thirdPartyIdentifiersHidden)
@@ -1294,7 +1294,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
constant += [self socialLoginViewHeightFittingWidth:self.contentView.frame.size.width];
}
if (BuildSettings.bwiEnableRegisterInfo)
if (BWIBuildSettings.shared.bwiEnableRegisterInfo)
{
constant += 100;
}
@@ -1306,7 +1306,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
- (void)setCustomServerFieldsVisible:(BOOL)isVisible
{
if (self.customServersContainer.isHidden != isVisible || BuildSettings.authScreenShowTestServerOptions)
if (self.customServersContainer.isHidden != isVisible || BWIBuildSettings.shared.authScreenShowTestServerOptions)
{
return;
}
@@ -1696,7 +1696,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
{
SocialLoginButtonMode socialLoginButtonMode = SocialLoginButtonModeContinue;
BOOL showSocialLoginView = BuildSettings.authScreenShowSocialLoginSection && (self.currentLoginSSOFlow ? YES : NO);
BOOL showSocialLoginView = BWIBuildSettings.shared.authScreenShowSocialLoginSection && (self.currentLoginSSOFlow ? YES : NO);
switch (self.authType)
{
@@ -1863,7 +1863,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
- (UITextField*)serverSelectionTextField {
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(40, 90, self.customServersContainer.frame.size.width-80, 30)];
textField.text = BuildSettings.serverConfigPreSelections[@"Prod"];
textField.text = BWIBuildSettings.shared.serverConfigPreSelections[@"Prod"];
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.font = [UIFont systemFontOfSize:15];
textField.placeholder = @"enter text";
@@ -1915,20 +1915,20 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
switch (segment.selectedSegmentIndex) {
case 0:
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Prod"]];
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Prod"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"Prod"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"Prod"]];
break;
case 1:
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"MSGDemo"]];
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"MSGDemo"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"MSGDemo"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"MSGDemo"]];
break;
case 2:
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"UAT"]];
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"UAT"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"UAT"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"UAT"]];
break;
case 3:
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Lab23"]];
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Lab23"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"Lab23"]];
[self setHomeServerTextFieldText:BWIBuildSettings.shared.serverConfigPreSelections[@"Lab23"]];
break;
default:
break;
@@ -75,8 +75,8 @@ final class LegacyAuthenticationCoordinator: NSObject, AuthenticationCoordinator
// Configure custom servers if already customised by a deep link.
let homeserver = authenticationService.state.homeserver.address
let identityServer = authenticationService.state.identityServer
if homeserver != BuildSettings.serverConfigDefaultHomeserverUrlString
|| (identityServer != nil && identityServer != BuildSettings.serverConfigDefaultIdentityServerUrlString) {
if homeserver != BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString
|| (identityServer != nil && identityServer != BWIBuildSettings.shared.serverConfigDefaultIdentityServerUrlString) {
authenticationViewController.showCustomHomeserver(homeserver, andIdentityServer: identityServer)
}
@@ -209,7 +209,7 @@
if ([self isFlowSupported:kMXLoginFlowTypePassword])
{
BOOL showPhoneTextField = BuildSettings.authScreenShowPhoneNumber;
BOOL showPhoneTextField = BWIBuildSettings.shared.authScreenShowPhoneNumber;
self.passWordTextField.returnKeyType = UIReturnKeyDone;
self.phoneTextField.returnKeyType = UIReturnKeyNext;
@@ -1376,7 +1376,7 @@
if (textField == self.userLoginTextField && type == MXKAuthenticationTypeLogin)
{
// bwi: only enable MatrixID Login in some cases
if ([MXTools isMatrixUserIdentifier:self.userLoginTextField.text] && BwiBuildSettings.bwiEnableLoginWithMatrixID)
if ([MXTools isMatrixUserIdentifier:self.userLoginTextField.text] && BWIBuildSettings.shared.bwiEnableLoginWithMatrixID)
{
if (self.delegate && [self.delegate respondsToSelector:@selector(authInputsView:autoDiscoverServerWithDomain:)])
{
+1 -1
View File
@@ -107,7 +107,7 @@ class AvatarView: UIView, Themable {
}
// bwi use custom image for personal notes room
if BwiBuildSettings.bwiUseCustomPersonalNotesAvatar {
if BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar {
if let session = AppDelegate.theDelegate().mxSessions.first as? MXSession {
let service = PersonalNotesDefaultService(mxSession: session)
if let personalNotesRoomId = service.personalNotesRoomId(), personalNotesRoomId == viewData.matrixItemId {
@@ -56,7 +56,7 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if( [BuildSettings showTopBanner] ) {
if( [BWIBuildSettings.shared showTopBanner] ) {
[self showTopBanner];
}
}
@@ -65,7 +65,7 @@
{
[super viewWillDisappear:animated];
if( bannersInitialized && [BuildSettings showTopBanner] ) {
if( bannersInitialized && [BWIBuildSettings.shared showTopBanner] ) {
[self hideTopBanner];
}
}
@@ -148,7 +148,7 @@
self->bannersInitialized = TRUE;
if( [BuildSettings showTopBanner] ) {
if( [BWIBuildSettings.shared showTopBanner] ) {
[self showTopBanner];
}
}
@@ -2365,7 +2365,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
title:@""
handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
if ([BuildSettings roomSettingsScreenShowNotificationsV2])
if ([BWIBuildSettings.shared roomSettingsScreenShowNotificationsV2])
{
[self changeEditedRoomNotificationSettings];
}
@@ -2456,7 +2456,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
- (void)checkAppVersionDeprecated {
ValidAppVersionsDefaultService *appVersionsService = [[ValidAppVersionsDefaultService alloc] init];
if( BwiBuildSettings.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionDeprecated ) {
if( BWIBuildSettings.shared.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionDeprecated ) {
MXWeakify(self);
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[BWIL10n bwiOutdatedVersionWarningTitle]
@@ -2485,7 +2485,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
- (void)checkAppVersionOutdated {
ValidAppVersionsDefaultService *appVersionsService = [[ValidAppVersionsDefaultService alloc] init];
if (BwiBuildSettings.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionOutdated && !appVersionsService.wasOutdatedAlertShown) {
if (BWIBuildSettings.shared.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionOutdated && !appVersionsService.wasOutdatedAlertShown) {
MXWeakify(self);
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[BWIL10n bwiOutdatedVersionWarningTitle]
message:[BWIL10n bwiOutdatedVersionWarningMessage:AppInfo.current.displayName]
@@ -100,7 +100,7 @@
if (0 < roomCellData.notificationCount)
{
if( [BwiBuildSettings showMentionsInRoom] ) {
if( [BWIBuildSettings.shared showMentionsInRoom] ) {
self.missedNotifAndUnreadIndicator.backgroundColor = [Mentions countMentionsWithRoomID:roomCellData.roomIdentifier] > 0 ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor;
} else {
self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor;
@@ -132,7 +132,7 @@
// bwi: if the room is a personal notes room a local image is used as room avatar
PersonalNotesDefaultService *service = [[PersonalNotesDefaultService alloc] initWithMxSession:roomCellData.mxSession];
if (BwiBuildSettings.bwiUseCustomPersonalNotesAvatar && [roomCellData.roomIdentifier isEqualToString:[service personalNotesRoomId]]) {
if (BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar && [roomCellData.roomIdentifier isEqualToString:[service personalNotesRoomId]]) {
self.roomAvatar.image = [UIImage imageNamed:[service avatarImageUrl]];
} else {
[self.roomAvatar vc_setRoomAvatarImageWith:roomCellData.avatarUrl
@@ -79,7 +79,7 @@
- (void)setURL:(NSString *)URL
{
if (webView && BuildSettings.enableJSInWebView == false) {
if (webView && BWIBuildSettings.shared.enableJSInWebView == false) {
webView.configuration.preferences.javaScriptEnabled = NO;
}
@@ -88,7 +88,7 @@
- (void)setLocalHTMLFile:(NSString *)localHTMLFile
{
if (webView && BuildSettings.enableJSInWebView == false) {
if (webView && BWIBuildSettings.shared.enableJSInWebView == false) {
webView.configuration.preferences.javaScriptEnabled = NO;
}
@@ -238,7 +238,7 @@
*/
- (void)updateFooterViewVisibility
{
if (!BuildSettings.allowLocalContactsAccess || self.disableFindYourContactsFooter)
if (!BWIBuildSettings.shared.allowLocalContactsAccess || self.disableFindYourContactsFooter)
{
self.contactsTableView.tableFooterView = [[UIView alloc] init];
return;
@@ -314,7 +314,7 @@
- (void)refreshLocalContacts
{
if (!BuildSettings.allowLocalContactsAccess)
if (!BWIBuildSettings.shared.allowLocalContactsAccess)
{
return;
}
@@ -484,7 +484,7 @@
}
// Keep visible the header for the both contact sections, even if they're are empty.
if (BuildSettings.allowLocalContactsAccess && self.showLocalContacts && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
if (BWIBuildSettings.shared.allowLocalContactsAccess && self.showLocalContacts && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
{
filteredLocalContactsSection = count++;
}
@@ -499,7 +499,7 @@
}
// Keep visible the local contact header, even if the section is empty.
if (BuildSettings.allowLocalContactsAccess && self.showLocalContacts && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
if (BWIBuildSettings.shared.allowLocalContactsAccess && self.showLocalContacts && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
{
filteredLocalContactsSection = count++;
}
@@ -205,7 +205,7 @@
self.headerView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor;
self.contactNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
self.contactStatusLabel.textColor = ThemeService.shared.theme.tintColor;
self.contactStatusLabel.hidden = BuildSettings.allowLocalContactPresence ? NO : YES;
self.contactStatusLabel.hidden = BWIBuildSettings.shared.allowLocalContactPresence ? NO : YES;
// Check the table view style to select its bg color.
self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor);
@@ -55,7 +55,7 @@
// apply the vector colours
self.contactDisplayNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
self.contactInformationLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
self.contactInformationLabel.hidden = BuildSettings.allowLocalContactPresence ? NO : YES;
self.contactInformationLabel.hidden = BWIBuildSettings.shared.allowLocalContactPresence ? NO : YES;
self.powerLevelLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
// Clear the default background color of a MXKImageView instance
@@ -316,7 +316,7 @@
- (void)refreshContactPresence
{
if (BuildSettings.allowLocalContactPresence) {
if (BWIBuildSettings.shared.allowLocalContactPresence) {
NSString* presenceText;
NSString* matrixId = self.firstMatrixId;
@@ -35,7 +35,7 @@ class RoomActionProvider: RoomActionProviderProtocol {
var menu: UIMenu {
if service.isRoomJoined {
// bwi use our set of actions
if BwiBuildSettings.bwiFilteredContextMenu {
if BWIBuildSettings.shared.bwiFilteredContextMenu {
if service.roomId == PersonalNotesDefaultService(mxSession: service.session).personalNotesRoomId() {
return UIMenu(children: [
self.notificationsAction
@@ -162,7 +162,7 @@ final class EnterNewRoomDetailsViewController: UIViewController {
self.updateSections()
// scroll bottom to show user new fields
if BuildSettings.enableShowInRoomDirectory {
if BWIBuildSettings.shared.enableShowInRoomDirectory {
DispatchQueue.main.async {
let roomAddressSection = (section3 == nil ? 5 : 6)
self.mainTableView.vc_scrollToBottom()
@@ -186,7 +186,7 @@ final class EnterNewRoomDetailsViewController: UIViewController {
footer = VectorL10n.createRoomSectionFooterTypePublic
}
if BwiBuildSettings.bwiShowRoomCreationSectionFooter == false {
if BWIBuildSettings.shared.bwiShowRoomCreationSectionFooter == false {
footer = ""
}
@@ -211,7 +211,7 @@ final class EnterNewRoomDetailsViewController: UIViewController {
// if BuildSettings.enableShowInRoomDirectory {
if BuildSettings.enableShowInRoomDirectory {
if BWIBuildSettings.shared.enableShowInRoomDirectory {
if viewModel.roomCreationParameters.joinRule == .public {
let row_5_0 = Row(type: .withSwitch(isOn: viewModel.roomCreationParameters.showInDirectory, onValueChanged: { [weak self] (theSwitch) in
self?.viewModel.roomCreationParameters.showInDirectory = theSwitch.isOn
@@ -107,7 +107,7 @@ final class EnterNewRoomDetailsViewModel: EnterNewRoomDetailsViewModelType {
}
return alias
} else if BwiBuildSettings.bwiAutoCreateAliasOnRoomCreation {
} else if BWIBuildSettings.shared.bwiAutoCreateAliasOnRoomCreation {
if let roomName = roomCreationParameters.name {
return self.createAlias(from: roomName)
}
@@ -135,7 +135,7 @@ final class EnterNewRoomDetailsViewModel: EnterNewRoomDetailsViewModelType {
self.viewState = .loaded
// bwi: set correct room history visibilty
let visibility = BwiBuildSettings.enableSharedHistoryOnRoomCreation ? MXRoomHistoryVisibility.shared : MXRoomHistoryVisibility.invited
let visibility = BWIBuildSettings.shared.enableSharedHistoryOnRoomCreation ? MXRoomHistoryVisibility.shared : MXRoomHistoryVisibility.invited
self.currentOperation = room.setHistoryVisibility(visibility, completion: { response in
@@ -86,7 +86,7 @@
messagesSearchViewController = [HomeMessagesSearchViewController searchViewController];
if (BuildSettings.showUnifiedSearchViewMessagesTab)
if (BWIBuildSettings.shared.showUnifiedSearchViewMessagesTab)
{
messagesSearchViewController.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenSearchMessages];
[viewControllers addObject:messagesSearchViewController];
@@ -102,7 +102,7 @@
filesSearchViewController = [HomeFilesSearchViewController searchViewController];
if (BuildSettings.showUnifiedSearchViewFilesTab)
if (BWIBuildSettings.shared.showUnifiedSearchViewFilesTab)
{
filesSearchViewController.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenSearchFiles];
[viewControllers addObject:filesSearchViewController];
@@ -350,7 +350,7 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
})
var subMenuActions: [UIAction] = []
if BuildSettings.sideMenuShowInviteFriends {
if BWIBuildSettings.shared.sideMenuShowInviteFriends {
subMenuActions.append(UIAction(title: VectorL10n.sideMenuActionInviteFriends, image: UIImage(systemName: "square.and.arrow.up.fill")) { [weak self] action in
guard let self = self else { return }
self.showInviteFriends(from: self.avatarMenuButton)
@@ -286,7 +286,7 @@ final class JitsiService: NSObject {
// This url can be used as is inside a web container (like iframe for Riot-web)
// Build it from the riot-web app
let appUrlString = BuildSettings.applicationWebAppUrlString
let appUrlString = BWIBuildSettings.shared.applicationWebAppUrlString
// We mix v1 and v2 param for backward compability
let v1queryStringParts = [
@@ -137,7 +137,7 @@ final class KeyVerificationCoordinator: KeyVerificationCoordinatorType {
case .incomingSASTransaction(let incomingSASTransaction):
rootCoordinator = self.createDataLoadingScreenCoordinator(otherUserId: incomingSASTransaction.otherUserId, otherDeviceId: incomingSASTransaction.otherDeviceId)
case .completeSecurity(let isNewSignIn):
if BuildSettings.disableSelfUserVerification {
if BWIBuildSettings.shared.disableSelfUserVerification {
let coordinator = self.createSecretsRecoveryCoordinator(with: .passphraseOrKey)
rootCoordinator = coordinator
} else {
@@ -131,7 +131,7 @@ final class UserVerificationSessionStatusViewController: UIViewController {
self.manuallyVerifyButton.setTitle(VectorL10n.userVerificationSessionDetailsVerifyActionCurrentUserManually, for: .normal)
if BuildSettings.disableSelfUserVerification {
if BWIBuildSettings.shared.disableSelfUserVerification {
self.verifyButton.isHidden = true
self.manuallyVerifyButton.isHidden = true
}
@@ -160,7 +160,7 @@ final class UserVerificationSessionStatusViewController: UIViewController {
self.untrustedSessionContainerView.isHidden = viewData.isDeviceTrusted
self.manuallyVerifyButton.isHidden = !viewData.isCurrentUser || BuildSettings.disableSelfUserVerification
self.manuallyVerifyButton.isHidden = !viewData.isCurrentUser || BWIBuildSettings.shared.disableSelfUserVerification
if viewData.isDeviceTrusted {
badgeImage = Asset.Images.encryptionTrusted.image
@@ -978,9 +978,9 @@
if (sender == _submitButton)
{
if (BwiBuildSettings.bwiEnableLoginProtection) {
if (BWIBuildSettings.shared.bwiEnableLoginProtection) {
LoginProtectionService* service = [[LoginProtectionService alloc] init];
service.hashes = BwiBuildSettings.bwiHashes;
service.hashes = BWIBuildSettings.shared.bwiHashes;
if (![service isValid:self->mxRestClient.homeserver]) {
NSError *error = [[NSError alloc] initWithDomain:@"LoginProtectionError" code:0 userInfo:@{
NSLocalizedDescriptionKey: [BWIL10n bwiLoginProtectionErrorMessage:AppInfo.current.displayName]}];
@@ -672,7 +672,7 @@ static NSArray<NSNumber*> *initialSyncSilentErrorsHTTPStatusCodes;
{
userPresence = presence;
if (mxSession && (!hideUserPresence || BuildSettings.bwiPersonalState))
if (mxSession && (!hideUserPresence || BWIBuildSettings.shared.bwiPersonalState))
{
// Update user presence on server side
[mxSession.myUser setPresence:userPresence
@@ -1270,7 +1270,7 @@ NSString *const MXKContactManagerDataType = @"org.matrix.kit.MXKContactManagerDa
- (void)refreshMatrixContacts
{
// bwi: only refresh contacts when file can be encrypted (SecureFileStore is only unlocked after Pin/pasphrase
if ( BwiBuildSettings.forcedPinProtection && !EncryptionKeyManager.shared.isInitFinished ) {
if ( BWIBuildSettings.shared.forcedPinProtection && !EncryptionKeyManager.shared.isInitFinished ) {
return;
};
@@ -78,7 +78,7 @@ final class SingleImagePickerPresenter: NSObject {
alert.addAction(photoLibraryAction)
// BWI: remove avatars
if BuildSettings.enableRemoveAvatarImage && allowsRemoveImage {
if BWIBuildSettings.shared.enableRemoveAvatarImage && allowsRemoveImage {
let removePhotoAction = UIAlertAction(title: BWIL10n.imagePickerActionRemovePhoto, style: .destructive, handler: { _ in
self.removeImage()
})
@@ -99,22 +99,22 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
func start() {
// TODO: Manage a separate flow for soft logout that just uses AuthenticationCoordinator
if authenticationService.softLogoutCredentials != nil {
if BwiBuildSettings.showBwiSplashScreen || BuildSettings.authScreenShowRegister {
if BWIBuildSettings.shared.showBwiSplashScreen || BWIBuildSettings.shared.authScreenShowRegister {
showBwiSplashScreen()
} else {
showEmptyScreen()
}
startLoading()
if BuildSettings.onboardingEnableNewAuthenticationFlow {
if BWIBuildSettings.shared.onboardingEnableNewAuthenticationFlow {
beginAuthentication(with: .login) { [weak self] in
self?.stopLoading()
}
} else {
showLegacyAuthenticationScreen(forceAsRootModule: true)
}
} else if BwiBuildSettings.showBUMLottieAnimation {
} else if BWIBuildSettings.shared.showBUMLottieAnimation {
showBwiSplashScreen()
} else if BuildSettings.authScreenShowRegister {
} else if BWIBuildSettings.shared.authScreenShowRegister {
showSplashScreen()
} else {
showLegacyAuthenticationScreen()
@@ -184,7 +184,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
case .register:
showUseCaseSelectionScreen()
case .login:
if BuildSettings.onboardingEnableNewAuthenticationFlow {
if BWIBuildSettings.shared.onboardingEnableNewAuthenticationFlow {
beginAuthentication(with: .login, onStart: coordinator.stop)
} else {
coordinator.stop()
@@ -221,7 +221,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
private func useCaseSelectionCoordinator(_ coordinator: OnboardingUseCaseSelectionCoordinator, didCompleteWith result: OnboardingUseCaseViewModelResult) {
useCaseResult = result
guard BuildSettings.onboardingEnableNewAuthenticationFlow else {
guard BWIBuildSettings.shared.onboardingEnableNewAuthenticationFlow else {
showLegacyAuthenticationScreen()
coordinator.stop()
return
@@ -288,7 +288,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
coordinator.start()
add(childCoordinator: coordinator)
if navigationRouter.modules.isEmpty || forceAsRootModule || BwiBuildSettings.showBUMLottieAnimation {
if navigationRouter.modules.isEmpty || forceAsRootModule || BWIBuildSettings.shared.showBUMLottieAnimation {
navigationRouter.setRootModule(coordinator, popCompletion: nil)
} else {
navigationRouter.push(coordinator, animated: true) { [weak self] in
@@ -328,7 +328,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
let userId = session.credentials.userId,
let userSession = UserSessionsService.shared.userSession(withUserId: userId) {
// Skip personalisation when a generic SSO provider was used in case it already included the same steps.
let shouldShowPersonalization = BuildSettings.onboardingShowAccountPersonalization && authenticationType.analyticsType != .SSO
let shouldShowPersonalization = BWIBuildSettings.shared.onboardingShowAccountPersonalization && authenticationType.analyticsType != .SSO
// If personalisation is to be shown, check that the homeserver supports it otherwise show the congratulations screen
if shouldShowPersonalization {
+2 -2
View File
@@ -109,9 +109,9 @@
if (@available(iOS 14.0, *)) {
MXSession* session = [self mainSession];
if (session && [BuildSettings bwiShowHappyBirthdayCampaign]) {
if (session && [BWIBuildSettings.shared bwiShowHappyBirthdayCampaign]) {
__block RiotSharedSettings *sharedSettings = [[RiotSharedSettings alloc] initWithSession:session];
NSString *identifier = [BuildSettings bwiHappyBirthdayCampaignIdentifier];
NSString *identifier = [BWIBuildSettings.shared bwiHappyBirthdayCampaignIdentifier];
if( [sharedSettings happyBirthdayCampaignFor:identifier] ) {
[self showHappyBirthdayScreen];
[sharedSettings setHappyBirthdayCampaign:identifier
@@ -825,7 +825,7 @@
[cell addGestureRecognizer:cellTapGesture];
// BWI: allow changing the image zoom level by double tab
if ([BwiBuildSettings allowDoubleTapOnImageAttachmentsForZoom]) {
if ([BWIBuildSettings.shared allowDoubleTapOnImageAttachmentsForZoom]) {
UITapGestureRecognizer *cellDoubleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onCollectionViewCellDoubleTap:)];
[cellDoubleTapGesture setNumberOfTapsRequired:2];
cell.tag = item;
@@ -282,7 +282,7 @@ const CGFloat kTypingCellHeight = 24;
{
if (bubbleData.isAttachmentWithThumbnail && bubbleData.attachment.type != MXKAttachmentTypeSticker)
{
if (BuildSettings.enableAntivirusScan)
if (BWIBuildSettings.shared.enableAntivirusScan)
{
MXKRoomBubbleCellData *roomBubbleCellData;
@@ -447,7 +447,7 @@ const CGFloat kTypingCellHeight = 24;
BOOL isCollapsableCellCollapsed = cellData.collapsable && cellData.collapsed;
if (BuildSettings.enableLastMessageTimestamp) {
if (BWIBuildSettings.shared.enableLastMessageTimestamp) {
// Display timestamp of the last message
if (cellData.containsLastMessage && !isCollapsableCellCollapsed)
{
@@ -71,7 +71,7 @@
self.rageShakeManager = [RageShakeManager sharedManager];
// Show / hide actions button in document preview according BuildSettings
self.allowActionsInDocumentPreview = BuildSettings.messageDetailsAllowShare;
self.allowActionsInDocumentPreview = BWIBuildSettings.shared.messageDetailsAllowShare;
}
- (void)viewDidLoad
@@ -410,7 +410,7 @@
}
}];
if (BuildSettings.allowLocalContactPresence)
if (BWIBuildSettings.shared.allowLocalContactPresence)
{
NSString* presenceText;
@@ -443,7 +443,7 @@
}
}
if (BwiBuildSettings.bwiUserLabelsMemberDetailsVisible) {
if (BWIBuildSettings.shared.bwiUserLabelsMemberDetailsVisible) {
NSString* userLabel = [self tmpUserLabel];
if (userLabel) {
@@ -566,7 +566,7 @@
{
isOneself = YES;
if( !BuildSettings.roomMemberDetailsHideLeaveButton) {
if( !BWIBuildSettings.shared.roomMemberDetailsHideLeaveButton) {
[otherActionsArray addObject:@(MXKRoomMemberDetailsActionLeave)];
}
@@ -697,7 +697,7 @@
[otherActionsArray addObject:@(MXKRoomMemberDetailsActionMention)];
}
if (BwiBuildSettings.bwiAllowUserPermalink)
if (BWIBuildSettings.shared.bwiAllowUserPermalink)
{
[otherActionsArray addObject:@(MXKRoomMemberDetailsActionPermalink)];
}
@@ -714,7 +714,7 @@
securityActionsArray = @[@(MXKRoomMemberDetailsActionSecurity)];
}
if ( BwiBuildSettings.bwiUserLabelsAdminSettingsVisible && oneSelfPowerLevel >= RoomPowerLevelAdmin) {
if ( BWIBuildSettings.shared.bwiUserLabelsAdminSettingsVisible && oneSelfPowerLevel >= RoomPowerLevelAdmin) {
[bwiUserLabelsArray addObject:@(MXKRoomMemberDetailsActionBwiUserLabelDescription)];
[bwiUserLabelsArray addObject:@(MXKRoomMemberDetailsActionBwiUserLabel)];
}
@@ -1194,7 +1194,7 @@
UIButton *button = (UIButton*)sender;
BOOL isUpgradable = BuildSettings.bwiLastAdminCanDowngradeHimself ||
BOOL isUpgradable = BWIBuildSettings.shared.bwiLastAdminCanDowngradeHimself ||
![self.mxRoomMember.userId isEqualToString:self.mainSession.myUser.userId] ||
![self isLastAdmin:self.mainSession.myUser.userId];
switch (button.tag)
@@ -542,7 +542,7 @@
{
AccountRestrictionService *service = [[AccountRestrictionService alloc] initWithMxSession:room.mxSession];
self.showInviteUserFab = !(room.isDirect || BwiBuildSettings.allowInviteOnDirectRooms) && !room.isPersonalNotesRoom
self.showInviteUserFab = !(room.isDirect || BWIBuildSettings.shared.allowInviteOnDirectRooms) && !room.isPersonalNotesRoom
&& ![service isAddressListRestriction];
if (_showInviteUserFab)
@@ -782,7 +782,7 @@
// ...and then alphabetically.
// We could tiebreak instead by "last recently spoken in this room" if we wanted to.
NSComparator comparator = ^NSComparisonResult(Contact *contactA, Contact *contactB) {
if (BwiBuildSettings.bwiUserLabelParticipantSorting == true) {
if (BWIBuildSettings.shared.bwiUserLabelParticipantSorting == true) {
return [self bwiParticipantsCompareLeft:contactA right:contactB];
}
@@ -1122,13 +1122,13 @@
participantCell.contactDisplayNameLabel.text = [roomState.members memberName:contact.mxMember.userId];
}
if (BwiBuildSettings.bwiUserLabelsParticipantsVisible) {
if (BWIBuildSettings.shared.bwiUserLabelsParticipantsVisible) {
contact.bwiUserLabel = [self.bwiUserLabelService getUserLabelWithUser:contact.mxMember.userId];
participantCell.powerLevelLabel.text = contact.bwiUserLabel;
}
if (BuildSettings.bwiPersonalState && contact.mxMember.userId) {
if (BWIBuildSettings.shared.bwiPersonalState && contact.mxMember.userId) {
MXUser *user = [self.mxRoom.mxSession userWithUserId:contact.mxMember.userId];
participantCell.contactInformationLabel.text = user.statusMsg;
participantCell.contactInformationLabel.hidden = user.statusMsg.length <= 0;
@@ -221,7 +221,7 @@ final class RoomInfoListViewController: UIViewController {
var rows = [rowSettings]
if BuildSettings.bwiRollsAndRights && !(viewModel.isPersonalNotesRoom() || viewModel.isDirectRoom()) {
if BWIBuildSettings.shared.bwiRollsAndRights && !(viewModel.isPersonalNotesRoom() || viewModel.isDirectRoom()) {
rows.append(rowRollsAndRights)
}
if BuildSettings.showNotificationsV2 {
@@ -233,11 +233,11 @@ final class RoomInfoListViewController: UIViewController {
rows.append(rowMembers)
rows.append(rowUploads)
if BwiBuildSettings.bwiShowRoomSearch {
if BWIBuildSettings.shared.bwiShowRoomSearch {
rows.append(rowSearch)
}
if BwiBuildSettings.bwiAllowRoomPermalink {
if BWIBuildSettings.shared.bwiAllowRoomPermalink {
rows.append(rowPermalink)
}
@@ -253,7 +253,7 @@ final class RoomInfoListViewController: UIViewController {
VectorL10n.roomParticipantsLeavePromptTitleForDm :
VectorL10n.roomParticipantsLeavePromptTitle
let rowLeave = Row(type: .destructive, icon: Asset.Images.roomActionLeave.image, text: leaveTitle, accessoryType: .none) {
if BuildSettings.lastAdminIsNotAllowedToLeaveRoom {
if BWIBuildSettings.shared.lastAdminIsNotAllowedToLeaveRoom {
self.present(self.getLeaveAlertController(), animated: true, completion: nil)
} else {
self.present(self.leaveAlertController, animated: true, completion: nil)
@@ -521,7 +521,7 @@ extension RoomInfoListViewController {
rows.append(rowUploads)
if BuildSettings.bwiPersonalNotesRoomLeavable {
if BWIBuildSettings.shared.bwiPersonalNotesRoomLeavable {
let leaveTitle = VectorL10n.roomParticipantsLeavePromptTitle
let rowLeave = Row(type: .destructive, icon: Asset.Images.roomActionLeave.image, text: leaveTitle, accessoryType: .none) {
self.present(self.leaveAlertController, animated: true, completion: nil)
@@ -78,7 +78,7 @@ class RoomInfoBasicView: UIView {
func configure(withViewData viewData: RoomInfoBasicViewData) {
let avatarImage = AvatarGenerator.generateAvatar(forMatrixItem: viewData.roomId, withDisplayName: viewData.roomDisplayName)
if BwiBuildSettings.bwiUseCustomPersonalNotesAvatar {
if BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar {
if let session = AppDelegate.theDelegate().mxSessions.first as? MXSession {
let service = PersonalNotesDefaultService(mxSession: session)
if let personalNotesRoomId = service.personalNotesRoomId(), personalNotesRoomId == viewData.roomId {
+15 -15
View File
@@ -337,7 +337,7 @@ static CGSize kThreadListBarButtonItemImageSize;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventDidChangeIdentifier:) name:kMXEventDidChangeIdentifierNotification object:nil];
// Show / hide actions button in document preview according BuildSettings
self.allowActionsInDocumentPreview = BuildSettings.messageDetailsAllowShare;
self.allowActionsInDocumentPreview = BWIBuildSettings.shared.messageDetailsAllowShare;
_voiceMessageController = [[VoiceMessageController alloc] initWithThemeService:ThemeService.shared mediaServiceProvider:VoiceMessageMediaServiceProvider.sharedProvider];
self.voiceMessageController.delegate = self;
@@ -352,7 +352,7 @@ static CGSize kThreadListBarButtonItemImageSize;
[self vc_removeBackTitle];
if (BuildSettings.enableAntivirusScan)
if (BWIBuildSettings.shared.enableAntivirusScan)
{
// Register antivirus scan cells
[self registerContentScannerCells];
@@ -606,7 +606,7 @@ static CGSize kThreadListBarButtonItemImageSize;
[VoiceMessageMediaServiceProvider.sharedProvider pauseAllServices];
if([BwiBuildSettings showMentionsInRoom]) {
if([BWIBuildSettings.shared showMentionsInRoom]) {
[Mentions setCountMentionsToZeroWithRoomID:self.roomDataSource.roomId];
}
@@ -1764,7 +1764,7 @@ static CGSize kThreadListBarButtonItemImageSize;
return NO;
}
BOOL callOptionAllowed = (self.roomDataSource.room.isDirect && RiotSettings.shared.roomScreenAllowVoIPForDirectRoom) || (!self.roomDataSource.room.isDirect && RiotSettings.shared.roomScreenAllowVoIPForNonDirectRoom);
return callOptionAllowed && BuildSettings.allowVoIPUsage && self.roomDataSource.mxSession.callManager && self.roomDataSource.room.summary.membersCount.joined >= 2;
return callOptionAllowed && BWIBuildSettings.shared.allowVoIPUsage && self.roomDataSource.mxSession.callManager && self.roomDataSource.room.summary.membersCount.joined >= 2;
}
- (BOOL)isCallActive
@@ -1926,7 +1926,7 @@ static CGSize kThreadListBarButtonItemImageSize;
// Set user picture in input toolbar
// bwi: if the room is a personal notes room a local image is used as room avatar
if (userPictureView) {
if (BwiBuildSettings.bwiUseCustomPersonalNotesAvatar
if (BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar
&& [self.roomDataSource.room isPersonalNotesRoom]) {
PersonalNotesDefaultService *service = [PersonalNotesDefaultService service:self.mainSession];
@@ -2555,7 +2555,7 @@ static CGSize kThreadListBarButtonItemImageSize;
- (ScreenPresentationParameters*)buildUniversalLinkPresentationParameters
{
return [[ScreenPresentationParameters alloc] initWithRestoreInitialDisplay:NO stackAboveVisibleViews:BuildSettings.allowSplitViewDetailsScreenStacking sender:self sourceView:nil];
return [[ScreenPresentationParameters alloc] initWithRestoreInitialDisplay:NO stackAboveVisibleViews:BWIBuildSettings.shared.allowSplitViewDetailsScreenStacking sender:self sourceView:nil];
}
- (BOOL)handleUniversalLinkURL:(NSURL*)url
@@ -3019,7 +3019,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}
// Select the suitable table view cell class, by considering first the empty bubble cell.
if (BuildSettings.enableAntivirusScan && bubbleData.showAntivirusScanStatus)
if (BWIBuildSettings.shared.enableAntivirusScan && bubbleData.showAntivirusScanStatus)
{
// FRANK181
cellIdentifier = [self contentScannerClassForBubbleCellData:roomBubbleCellData];
@@ -3905,7 +3905,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}]];
}
if (!isJitsiCallEvent && BuildSettings.messageDetailsAllowShare && selectedEvent.eventType != MXEventTypePollStart &&
if (!isJitsiCallEvent && BWIBuildSettings.shared.messageDetailsAllowShare && selectedEvent.eventType != MXEventTypePollStart &&
selectedEvent.eventType != MXEventTypeBeaconInfo)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeShare
@@ -3956,7 +3956,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}]];
}
if (BuildSettings.messageDetailsAllowSave)
if (BWIBuildSettings.shared.messageDetailsAllowSave)
{
if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo)
{
@@ -4031,7 +4031,7 @@ static CGSize kThreadListBarButtonItemImageSize;
if (attachment.type != MXKAttachmentTypeSticker)
{
if (BuildSettings.messageDetailsAllowShare)
if (BWIBuildSettings.shared.messageDetailsAllowShare)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeShare
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionShare]
@@ -4101,7 +4101,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}
}
if (BuildSettings.messageDetailsAllowPermalink)
if (BWIBuildSettings.shared.messageDetailsAllowPermalink)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypePermalink
action:[UIAlertAction actionWithTitle:[BWIL10n roomEventActionPermalink]
@@ -4131,7 +4131,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}]];
}
if (BuildSettings.messageDetailsAllowViewSource)
if (BWIBuildSettings.shared.messageDetailsAllowViewSource)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeViewSource
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionViewSource]
@@ -5466,7 +5466,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}
// bwi remove ignored users from typing users
if (BwiBuildSettings.bwiBetterIgnoredUsers) {
if (BWIBuildSettings.shared.bwiBetterIgnoredUsers) {
for (NSString* ignoredId in self.mainSession.ignoredUsers) {
NSUInteger index = [typingUsers indexOfObject:ignoredId];
if (index != NSNotFound)
@@ -6974,7 +6974,7 @@ static CGSize kThreadListBarButtonItemImageSize;
BOOL result = !attachment || attachment.type != MXKAttachmentTypeSticker;
if (attachment && !BuildSettings.messageDetailsAllowCopyMedia)
if (attachment && !BWIBuildSettings.shared.messageDetailsAllowCopyMedia)
{
result = NO;
}
@@ -7147,7 +7147,7 @@ static CGSize kThreadListBarButtonItemImageSize;
return !self.roomDataSource.threadId
&& !event.threadId
&& (RiotSettings.shared.enableThreads || self.mainSession.store.supportedMatrixVersions.supportsThreads)
&& BwiBuildSettings.bwiShowThreads;
&& BWIBuildSettings.shared.bwiShowThreads;
}
- (void)showThreadsNotice
@@ -521,7 +521,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
NSMutableArray<Section*> *tmpSections = [NSMutableArray arrayWithCapacity:SECTION_TAG_BANNED_ADVANCED + 1];
Section *sectionMain = [Section sectionWithTag:SECTION_TAG_MAIN];
if(!mxRoom.isDirect || BwiBuildSettings.showUnrelatedRoomSettingsForDirectMessages) {
if(!mxRoom.isDirect || BWIBuildSettings.shared.showUnrelatedRoomSettingsForDirectMessages) {
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_PHOTO];
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_NAME];
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_TOPIC];
@@ -531,7 +531,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
{
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_DIRECT_CHAT];
}
if (BwiBuildSettings.bwiNotificationTimes)
if (BWIBuildSettings.shared.bwiNotificationTimes)
{
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_REST_TIME];
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_REST_TIME_INFO];
@@ -543,7 +543,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_LEAVE];
[tmpSections addObject:sectionMain];
if (!BuildSettings.roomSettingsScreenRemoveLeave) {
if (!BWIBuildSettings.shared.roomSettingsScreenRemoveLeave) {
Section *sectionLeave = [Section sectionWithTag:SECTION_TAG_MAIN];
[sectionLeave addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_LEAVE];
[tmpSections addObject:sectionLeave];
@@ -587,7 +587,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
}
}
if ( BuildSettings.roomSettingsScreenShowAccessSettingsBW && !mxRoom.isDirect ){
if ( BWIBuildSettings.shared.roomSettingsScreenShowAccessSettingsBW && !mxRoom.isDirect ){
[tmpSections addObject:[self sectionForAccessSwitch]];
}
@@ -2230,7 +2230,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
else
{
// bwi if the room is a personal notes room use a local image
if (BwiBuildSettings.bwiUseCustomPersonalNotesAvatar && [mxRoom isPersonalNotesRoom] ) {
if (BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar && [mxRoom isPersonalNotesRoom] ) {
PersonalNotesDefaultService *service = [[PersonalNotesDefaultService alloc] initWithMxSession:self.mainSession];
roomPhotoCell.mxkImageView.image = [UIImage imageNamed:service.avatarImageUrl];
@@ -71,7 +71,7 @@ class VoiceMessagePlaybackController: VoiceMessageAudioPlayerDelegate, VoiceMess
updateTheme()
updateUI()
if BwiBuildSettings.bwiResignPlayingVoiceMessageInBackground {
if BWIBuildSettings.shared.bwiResignPlayingVoiceMessageInBackground {
NotificationCenter.default.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.willResignActiveNotification, object: nil)
}
@@ -33,8 +33,8 @@ class PublicRoomsDirectoryViewModel {
}
var directoryServerDisplayname: String? {
if BuildSettings.showCustomServerDisplayName {
return BuildSettings.customServerDisplayName
if BWIBuildSettings.shared.showCustomServerDisplayName {
return BWIBuildSettings.shared.customServerDisplayName
} else {
return dataSource.directoryServerDisplayname
}
@@ -67,7 +67,7 @@ final class ShowDirectoryCoordinator: ShowDirectoryCoordinatorType {
controller.finalizeInit()
let dataSource: MXKDirectoryServersDataSource = MXKDirectoryServersDataSource(matrixSession: session)
dataSource.finalizeInitialization()
dataSource.roomDirectoryServers = BuildSettings.publicRoomsDirectoryServers
dataSource.roomDirectoryServers = BWIBuildSettings.shared.publicRoomsDirectoryServers
controller.display(with: dataSource) { [weak self] (cellData) in
guard let self = self else { return }
@@ -166,7 +166,7 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
useRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart2)
useRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart3)
if BuildSettings.showRecoverWithKey == true {
if BWIBuildSettings.shared.showRecoverWithKey == true {
self.useRecoveryKeyButton.setAttributedTitle(useRecoveryKeyAttributedString, for: .normal)
} else {
self.useRecoveryKeyButton?.visiblity(gone: true, dimension: 0.0)
@@ -142,7 +142,7 @@ final class SecretsSetupRecoveryKeyViewController: UIViewController {
self.renderLoaded(passphraseOnly: passphraseOnly)
case .recoveryCreated(let recoveryKey):
self.renderRecoveryCreated(recoveryKey: recoveryKey)
if BuildSettings.skipKeyBackupStep {
if BWIBuildSettings.shared.skipKeyBackupStep {
self.viewModel.process(viewAction: .done)
}
case .error(let error):
@@ -204,7 +204,7 @@ final class SecureBackupSetupIntroViewController: UIViewController {
if keyBackup.keyBackupVersion != nil && keyBackup.hasPrivateKeyInCryptoStore == false {
// don't show dialog if forced, already asked before in mandatory verification recover
if BuildSettings.forceResetBackupIfLost {
if BWIBuildSettings.shared.forceResetBackupIfLost {
let alertController = UIAlertController(title: VectorL10n.secureKeyBackupSetupExistingBackupErrorTitle,
message: VectorL10n.secureKeyBackupSetupExistingBackupErrorInfo,
preferredStyle: .alert)
@@ -184,7 +184,7 @@ final class EnterPinCodeViewController: UIViewController {
}
// show BuM Logo instead of Element logo
if BwiBuildSettings.bwiEnableBuMUI {
if BWIBuildSettings.shared.bwiEnableBuMUI {
logoImageView.image = Asset.Images.launchScreenLogo.image
}
}
@@ -95,12 +95,12 @@ final class PinCodePreferences: NSObject {
/// Setting to force protection by pin code
var forcePinProtection: Bool {
return BwiBuildSettings.forcedPinProtection
return BWIBuildSettings.shared.forcePinProtection
}
/// Not allowed pin codes. User won't be able to select one of the pin in the list.
var notAllowedPINs: [String] {
return BuildSettings.notAllowedPINs
return BWIBuildSettings.shared.notAllowedPINs
}
/// Maximum number of allowed pin failures when unlocking, before force logging out the user
@@ -136,7 +136,7 @@ final class PinCodePreferences: NSObject {
/// Max allowed time to continue using the app without prompting PIN
var graceTimeInSeconds: TimeInterval {
return BuildSettings.pinCodeGraceTimeInSeconds
return BWIBuildSettings.shared.pinCodeGraceTimeInSeconds
}
/// Number of digits for the PIN
@@ -386,7 +386,7 @@ enum {
cell.imageView.image = AssetImages.encryptionWarning.image;
}
if (BuildSettings.bwiDisableSecuritySettingsUntrustedDevices && !deviceInfo.trustLevel.isVerified) {
if (BWIBuildSettings.shared.bwiDisableSecuritySettingsUntrustedDevices && !deviceInfo.trustLevel.isVerified) {
cell.accessoryType = UITableViewCellAccessoryNone;
} else {
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
@@ -552,7 +552,7 @@ enum {
}
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (BuildSettings.bwiDisableSecuritySettingsUntrustedDevices) {
if (BWIBuildSettings.shared.bwiDisableSecuritySettingsUntrustedDevices) {
if (indexPath.section == SECTION_SESSION_INFO && indexPath.row == SESSION_INFO_TRUST) {
NSString *deviceId = device.deviceId;
MXDeviceInfo *deviceInfo = [self.mainSession.crypto deviceWithDeviceId:deviceId ofUser:self.mainSession.myUser.userId];
@@ -348,7 +348,7 @@ TableViewSectionsDelegate>
}
else
{
if (BwiBuildSettings.bwiShowSessionSettingsFooter) {
if (BWIBuildSettings.shared.bwiShowSessionSettingsFooter) {
sessionsSection.footerTitle = VectorL10n.securitySettingsCryptoSessionsDescription2;
}
[sessionsSection addRowsWithCount:devicesArray.count];
@@ -372,7 +372,7 @@ TableViewSectionsDelegate>
// Cross-Signing
if (!BuildSettings.disableSelfUserVerification) {
if (!BWIBuildSettings.shared.disableSelfUserVerification) {
Section *crossSigningSection = [Section sectionWithTag:SECTION_CROSSSIGNING];
crossSigningSection.headerTitle = [VectorL10n securitySettingsCrosssigning];
+39 -39
View File
@@ -406,7 +406,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[tmpSections addObject:sectionDowntime];
}
if (BwiBuildSettings.bwiCheckAppVersion && [[[ValidAppVersionsDefaultService alloc] init] isCurrentAppVersionOutdated]) {
if (BWIBuildSettings.shared.bwiCheckAppVersion && [[[ValidAppVersionsDefaultService alloc] init] isCurrentAppVersionOutdated]) {
Section *sectionOutdated = [Section sectionWithTag:SECTION_TAG_OUTDATED_WARNING];
[sectionOutdated addRowWithTag:OUTDATED_WARNING];
sectionOutdated.headerTitle = [BWIL10n bwiOutdatedSettingsHeader];
@@ -416,7 +416,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
Section *sectionUserSettings = [Section sectionWithTag:SECTION_TAG_USER_SETTINGS];
[sectionUserSettings addRowWithTag:USER_SETTINGS_PROFILE_PICTURE_INDEX];
[sectionUserSettings addRowWithTag:USER_SETTINGS_DISPLAYNAME_INDEX];
if (BwiBuildSettings.bwiEnablePersonalState) {
if (BWIBuildSettings.shared.bwiEnablePersonalState) {
[sectionUserSettings addRowWithTag:USER_SETTINGS_PERSONAL_STATE_INDEX];
}
if (RiotSettings.shared.settingsScreenShowChangePassword)
@@ -433,7 +433,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
MXKAccount* account = [MXKAccountManager sharedManager].activeAccounts.firstObject;
// add linked emails
if (BuildSettings.settingsScreenAllowAddingLinkedEmails)
if (BWIBuildSettings.shared.settingsScreenAllowAddingLinkedEmails)
{
for (NSInteger index = 0; index < account.linkedEmails.count; index++)
{
@@ -441,22 +441,22 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
}
// add linked phone numbers
if (BuildSettings.settingsScreenAllowAddingPhoneNumbers)
if (BWIBuildSettings.shared.settingsScreenAllowAddingPhoneNumbers)
{
for (NSInteger index = 0; index < account.linkedPhoneNumbers.count; index++)
{
[sectionUserSettings addRowWithTag: USER_SETTINGS_PHONENUMBERS_OFFSET + index];
}
}
if (BuildSettings.settingsScreenAllowAddingEmailThreepids)
if (BWIBuildSettings.shared.settingsScreenAllowAddingEmailThreepids)
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_EMAIL_INDEX];
}
if (BuildSettings.settingsScreenAllowAddingPhoneThreepids)
if (BWIBuildSettings.shared.settingsScreenAllowAddingPhoneThreepids)
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_PHONENUMBER_INDEX];
}
if (BuildSettings.settingsScreenShowThreepidExplanatory)
if (BWIBuildSettings.shared.settingsScreenShowThreepidExplanatory)
{
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart1] attributes:@{}];
[attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart2] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.tintColor}]];
@@ -467,7 +467,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings];
[tmpSections addObject:sectionUserSettings];
if (BuildSettings.bwiShowNewFeatures)
if (BWIBuildSettings.shared.bwiShowNewFeatures)
{
Section *sectionNewFeatures = [Section sectionWithTag:SECTION_TAG_NEW_FEATURES];
[sectionNewFeatures addRowWithTag:SHOW_NEW_FEATURES];
@@ -475,7 +475,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[tmpSections addObject:sectionNewFeatures];
}
if (BuildSettings.settingsScreenShowConfirmMediaSize)
if (BWIBuildSettings.shared.settingsScreenShowConfirmMediaSize)
{
Section *sectionMedia = [Section sectionWithTag:SECTION_TAG_SENDING_MEDIA];
[sectionMedia addRowWithTag:SENDING_MEDIA_CONFIRM_SIZE];
@@ -484,7 +484,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[tmpSections addObject:sectionMedia];
}
if (BuildSettings.settingsScreenShowLinkPreviews)
if (BWIBuildSettings.shared.settingsScreenShowLinkPreviews)
{
Section *sectionLinks = [Section sectionWithTag:SECTION_TAG_LINKS];
[sectionLinks addRowWithTag:LINKS_SHOW_URL_PREVIEWS_INDEX];
@@ -511,7 +511,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
if (RiotSettings.shared.settingsScreenShowSystemSettingsOption) {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SYSTEM_SETTINGS];
}
if (BwiBuildSettings.bwiSettingsShowInAppNotifications) {
if (BWIBuildSettings.shared.bwiSettingsShowInAppNotifications) {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SHOW_IN_APP_INDEX];
}
if (RiotSettings.shared.settingsScreenShowNotificationDecodedContentOption)
@@ -519,7 +519,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SHOW_DECODED_CONTENT];
}
if (BwiBuildSettings.bwiShowPinnedNotificationSettings) {
if (BWIBuildSettings.shared.bwiShowPinnedNotificationSettings) {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_PIN_MISSED_NOTIFICATIONS_INDEX];
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_PIN_UNREAD_INDEX];
}
@@ -530,7 +530,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
if (RiotSettings.shared.settingsNotificationsShowMentions) {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_MENTION_AND_KEYWORDS_SETTINGS_INDEX];
}
if (BwiBuildSettings.bwiNotificationTimes) {
if (BWIBuildSettings.shared.bwiNotificationTimes) {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_NOTIFICATION_TIMES_INDEX];
}
if (RiotSettings.shared.settingsNotificationsShowAdvanced) {
@@ -540,20 +540,20 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
sectionNotificationSettings.headerTitle = [VectorL10n settingsNotifications];
[tmpSections addObject:sectionNotificationSettings];
if (BuildSettings.allowVoIPUsage && BuildSettings.stunServerFallbackUrlString && RiotSettings.shared.settingsScreenShowEnableStunServerFallback)
if (BWIBuildSettings.shared.allowVoIPUsage && BWIBuildSettings.shared.stunServerFallbackUrlString && RiotSettings.shared.settingsScreenShowEnableStunServerFallback)
{
Section *sectionCalls = [Section sectionWithTag:SECTION_TAG_CALLS];
sectionCalls.headerTitle = [VectorL10n settingsCallsSettings];
// Remove "stun:"
NSString* stunFallbackHost = [BuildSettings.stunServerFallbackUrlString componentsSeparatedByString:@":"].lastObject;
NSString* stunFallbackHost = [BWIBuildSettings.shared.stunServerFallbackUrlString componentsSeparatedByString:@":"].lastObject;
sectionCalls.footerTitle = [VectorL10n settingsCallsStunServerFallbackDescription:stunFallbackHost];
[sectionCalls addRowWithTag:CALLS_ENABLE_STUN_SERVER_FALLBACK_INDEX];
[tmpSections addObject:sectionCalls];
}
if (BuildSettings.settingsScreenShowDiscoverySettings)
if (BWIBuildSettings.shared.settingsScreenShowDiscoverySettings)
{
Section *sectionDiscovery = [Section sectionWithTag:SECTION_TAG_DISCOVERY];
NSInteger count = self.settingsDiscoveryTableViewSection.numberOfRows;
@@ -566,7 +566,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[tmpSections addObject:sectionDiscovery];
}
if (BuildSettings.settingsScreenAllowIdentityServerConfig)
if (BWIBuildSettings.shared.settingsScreenAllowIdentityServerConfig)
{
Section *sectionIdentityServer = [Section sectionWithTag:SECTION_TAG_IDENTITY_SERVER];
[sectionIdentityServer addRowWithTag:IDENTITY_SERVER_INDEX];
@@ -576,7 +576,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[tmpSections addObject:sectionIdentityServer];
}
if (BuildSettings.allowLocalContactsAccess)
if (BWIBuildSettings.shared.allowLocalContactsAccess)
{
Section *sectionLocalContacts = [Section sectionWithTag:SECTION_TAG_LOCAL_CONTACTS];
[sectionLocalContacts addRowWithTag:LOCAL_CONTACTS_SYNC_INDEX];
@@ -596,7 +596,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
Section *sectionIgnoredUsers = [Section sectionWithTag:SECTION_TAG_IGNORED_USERS];
if (BwiBuildSettings.bwiBetterIgnoredUsers) {
if (BWIBuildSettings.shared.bwiBetterIgnoredUsers) {
[sectionIgnoredUsers addRowWithTag:IGNORED_USERS_INDEX];
} else {
for (NSInteger index = 0; index < session.ignoredUsers.count; index++)
@@ -629,11 +629,11 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
sectionUserInterface = [self updateTimeLine:sectionUserInterface];
[tmpSections addObject: sectionUserInterface];
if (BuildSettings.bwiPersonalNotesRoom) {
if (BWIBuildSettings.shared.bwiPersonalNotesRoom) {
[sectionUserInterface addRowWithTag:USER_INTERFACE_PERSONAL_NOTES];
}
if (BuildSettings.bwiShowTimelineSettings) {
if (BWIBuildSettings.shared.bwiShowTimelineSettings) {
Section *sectionTimeline = [Section sectionWithTag:SECTION_TAG_TIMELINE];
sectionTimeline.headerTitle = VectorL10n.settingsTimeline;
@@ -660,7 +660,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
Section *sectionAdvanced = [Section sectionWithTag:SECTION_TAG_ADVANCED];
sectionAdvanced.headerTitle = [VectorL10n settingsAdvanced];
if (BuildSettings.settingsScreenShowAdvancedSettings)
if (BWIBuildSettings.shared.settingsScreenShowAdvancedSettings)
{
Section *sectionAdvanced = [Section sectionWithTag:SECTION_TAG_ADVANCED];
sectionAdvanced.headerTitle = [VectorL10n settingsAdvanced];
@@ -670,17 +670,17 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[sectionAdvanced addRowWithTag:ADVANCED_SHOW_NSFW_ROOMS_INDEX];
}
if (BuildSettings.settingsScreenAllowChangingCrashUsageDataSettings)
if (BWIBuildSettings.shared.settingsScreenAllowChangingCrashUsageDataSettings)
{
[sectionAdvanced addRowWithTag:ADVANCED_CRASH_REPORT_INDEX];
}
if (BuildSettings.settingsScreenAllowChangingRageshakeSettings)
if (BWIBuildSettings.shared.settingsScreenAllowChangingRageshakeSettings)
{
[sectionAdvanced addRowWithTag:ADVANCED_ENABLE_RAGESHAKE_INDEX];
}
[sectionAdvanced addRowWithTag:ADVANCED_MARK_ALL_AS_READ_INDEX];
[sectionAdvanced addRowWithTag:ADVANCED_CLEAR_CACHE_INDEX];
if (BuildSettings.settingsScreenAllowBugReportingManually)
if (BWIBuildSettings.shared.settingsScreenAllowBugReportingManually)
{
[sectionAdvanced addRowWithTag:ADVANCED_REPORT_BUG_INDEX];
}
@@ -693,12 +693,12 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[sectionAbout addRowWithTag:ABOUT_OLM_VERSION_INDEX];
// bwi 2098 - show element base version
if ([BuildSettings showElementBaseVersion])
if ([BWIBuildSettings.shared showElementBaseVersion])
{
[sectionAbout addRowWithTag:ABOUT_ELEMENT_VERSION_INDEX];
}
if (BuildSettings.settingsScreenShowSupportSetting)
if (BWIBuildSettings.shared.settingsScreenShowSupportSetting)
{
[sectionAbout addRowWithTag:ABOUT_SUPPORT_INDEX];
}
@@ -714,7 +714,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
[sectionAbout addRowWithTag:ABOUT_TERM_CONDITIONS_INDEX];
}
if (BuildSettings.applicationPrivacyPolicyUrlString.length)
if (BWIBuildSettings.shared.applicationPrivacyPolicyUrlString.length)
{
[sectionAbout addRowWithTag:ABOUT_PRIVACY_INDEX];
}
@@ -724,21 +724,21 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[sectionAbout addRowWithTag:ABOUT_MARK_ALL_AS_READ_INDEX];
[sectionAbout addRowWithTag:ABOUT_CLEAR_CACHE_INDEX];
if (BuildSettings.bwiShowDeveloperSettings) {
if (BWIBuildSettings.shared.bwiShowDeveloperSettings) {
Section *sectionDeveloper = [Section sectionWithTag:SECTION_TAG_DEVELOPER];
[sectionDeveloper addRowWithTag:DEVELOPER_SHOW_SETTINGS_INDEX];
sectionDeveloper.headerTitle = BWIL10n.bwiSettingsDeveloper;
[tmpSections addObject:sectionDeveloper];
}
if (BuildSettings.settingsScreenShowAdvancedSettings)
if (BWIBuildSettings.shared.settingsScreenShowAdvancedSettings)
{
sectionAbout.footerTitle = [self buildAboutSectionFooterTitleWithAccount:account];
}
[tmpSections addObject:sectionAbout];
if (BuildSettings.settingsScreenShowLabSettings)
if (BWIBuildSettings.shared.settingsScreenShowLabSettings)
{
Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS];
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
@@ -757,7 +757,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
}
if (BuildSettings.settingsScreenAllowDeactivatingAccount)
if (BWIBuildSettings.shared.settingsScreenAllowDeactivatingAccount)
{
Section *sectionDeactivate = [Section sectionWithTag:SECTION_TAG_DEACTIVATE_ACCOUNT];
[sectionDeactivate addRowWithTag:0];
@@ -2513,7 +2513,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
else if (section == SECTION_TAG_IGNORED_USERS)
{
MXKTableViewCell *ignoredUserCell = [self getDefaultTableViewCell:tableView];
if (BwiBuildSettings.bwiBetterIgnoredUsers) {
if (BWIBuildSettings.shared.bwiBetterIgnoredUsers) {
ignoredUserCell.textLabel.text = BWIL10n.bwiSettingsIgnoredUsersText;
} else {
ignoredUserCell.textLabel.text = session.ignoredUsers[row];
@@ -2606,7 +2606,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
MXKTableViewCell *versionCell = [self getDefaultTableViewCell:tableView];
versionCell.textLabel.text = [BWIL10n settingsElementVersion:[BuildSettings elementBaseVersion]];
versionCell.textLabel.text = [BWIL10n settingsElementVersion:[BWIBuildSettings.shared elementBaseVersion]];
versionCell.selectionStyle = UITableViewCellSelectionStyleNone;
@@ -3150,7 +3150,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
else if (section == SECTION_TAG_IGNORED_USERS)
{
if (BwiBuildSettings.bwiBetterIgnoredUsers) {
if (BWIBuildSettings.shared.bwiBetterIgnoredUsers) {
[self bwiShowIgnoredUsersScreen];
} else {
MXSession* session = self.mainSession;
@@ -3218,7 +3218,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
if (row == ABOUT_COPYRIGHT_INDEX)
{
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BuildSettings.applicationCopyrightUrlString];
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BWIBuildSettings.shared.applicationCopyrightUrlString];
webViewViewController.title = [BWIL10n settingsCopyright];
@@ -3244,7 +3244,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
else if (row == ABOUT_PRIVACY_INDEX)
{
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BuildSettings.applicationPrivacyPolicyUrlString];
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BWIBuildSettings.shared.applicationPrivacyPolicyUrlString];
webViewViewController.title = [VectorL10n settingsPrivacyPolicy];
@@ -3603,7 +3603,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
RiotSettings.shared.allowStunServerFallback = sender.isOn;
self.mainSession.callManager.fallbackSTUNServer = RiotSettings.shared.allowStunServerFallback ? BuildSettings.stunServerFallbackUrlString : nil;
self.mainSession.callManager.fallbackSTUNServer = RiotSettings.shared.allowStunServerFallback ? BWIBuildSettings.shared.stunServerFallbackUrlString : nil;
}
- (void)toggleAllowIntegrations:(UISwitch *)sender
@@ -5020,7 +5020,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
if (RiotSettings.shared.settingsScreenShowSimpleTimeLineOptions) {
[timelineSection addRowWithTag:TIMELINE_SIMPLE_INDEX];
} else {
if (BuildSettings.bwiShowMessageBubbles)
if (BWIBuildSettings.shared.bwiShowMessageBubbles)
{
[timelineSection addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
}
@@ -114,7 +114,7 @@ final class SideMenuViewModel: SideMenuViewModelType {
if RiotSettings.shared.settingsScreenShowFeedback {
sideMenuItems.append(.feedback)
}
if BuildSettings.sideMenuShowInviteFriends {
if BWIBuildSettings.shared.sideMenuShowInviteFriends {
sideMenuItems += [.inviteFriends]
}
@@ -146,7 +146,7 @@
- (void)showInviteFriendsHeaderView:(BOOL)show
{
if (!BuildSettings.directChatShowInviteFriends)
if (!BWIBuildSettings.shared.directChatShowInviteFriends)
{
show = NO;
}
+6 -6
View File
@@ -116,7 +116,7 @@
}];
// replace link
if (BwiBuildSettings.bwiReplaceFeatureLink) {
if (BWIBuildSettings.shared.bwiReplaceFeatureLink) {
[[[BwiNewFeatureHelper alloc] init] replaceFeatureHistoryLink];
}
}
@@ -235,7 +235,7 @@
}
}
if (BwiBuildSettings.bwiClearMediaCacheOnRoomExit) {
if (BWIBuildSettings.shared.bwiClearMediaCacheOnRoomExit) {
[MXMediaManager clearCache];
}
}
@@ -1095,13 +1095,13 @@
- (void) bwiCheckForPersonalNotesRoom {
PersonalNotesDefaultService *service = [PersonalNotesDefaultService service:self.mxSessions.firstObject];
if (BuildSettings.bwiResetPersonalNotesAccountData) {
if (BWIBuildSettings.shared.bwiResetPersonalNotesAccountData) {
[service resetPersonalNotesRoom];
}
if (BuildSettings.bwiPersonalNotesRoom) {
if (BWIBuildSettings.shared.bwiPersonalNotesRoom) {
[service createPersonalNotesRoomIfNeeded];
}
if (BwiBuildSettings.bwiUseCustomPersonalNotesAvatar) {
if (BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar) {
MXSession *mainSession = mxSessionArray.firstObject;
if (mainSession) {
@@ -1128,7 +1128,7 @@
preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:BWIL10n.bwiAnalyticsAlertInfoButton style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BuildSettings.applicationPrivacyPolicyUrlString];
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BWIBuildSettings.shared.applicationPrivacyPolicyUrlString];
webViewViewController.title = [VectorL10n settingsPrivacyPolicy];
[self.navigationController pushViewController:webViewViewController animated:YES];
}]];
+6 -6
View File
@@ -117,7 +117,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
self.addMatrixSessionToMasterTabBarController(userSession.matrixSession)
}
if BuildSettings.enableSideMenu {
if BWIBuildSettings.shared.enableSideMenu {
self.setupSideMenuGestures()
}
@@ -206,7 +206,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
func pinUnlocked() {
let serverDownTime = ServerDowntimeDefaultService()
if BwiBuildSettings.useTestDataForDowntime {
if BWIBuildSettings.shared.useTestDataForDowntime {
serverDownTime.fetchDowntimes {
self.createSettingsButton(self.masterTabBarController)
}
@@ -749,7 +749,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
return
}
guard BuildSettings.enableSideMenu else {
guard BWIBuildSettings.shared.enableSideMenu else {
let settingsBarButtonItem: MXKBarButtonItem = MXKBarButtonItem(image: Asset.Images.settingsIcon.image, style: .plain) { [weak self] in
self?.showSettings()
}
@@ -787,7 +787,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
})
var subMenuActions: [UIAction] = []
if BuildSettings.sideMenuShowInviteFriends {
if BWIBuildSettings.shared.sideMenuShowInviteFriends {
subMenuActions.append(UIAction(title: VectorL10n.inviteTo(AppInfo.current.displayName), image: UIImage(systemName: "envelope")) { [weak self] action in
self?.showInviteFriends(from: nil)
})
@@ -960,7 +960,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
let serverDownTime = ServerDowntimeDefaultService()
if serverDownTime.isDowntimePresentable() {
settingsBarButtonItem = ServerDowntimeBadge().createBadgeBarButton(color: serverDownTime.downtimeColor(), target: self, selector: #selector(showSettings))
} else if BwiBuildSettings.bwiCheckAppVersion && ValidAppVersionsDefaultService().isCurrentAppVersionOutdated() {
} else if BWIBuildSettings.shared.bwiCheckAppVersion && ValidAppVersionsDefaultService().isCurrentAppVersionOutdated() {
settingsBarButtonItem = ServerDowntimeBadge().createBadgeBarButton(color: .yellow, target: self, selector: #selector(showSettings))
} else {
settingsBarButtonItem = MXKBarButtonItem(image: Asset.Images.settingsIcon.image, style: .plain) { [weak self] in
@@ -997,7 +997,7 @@ extension TabBarCoordinator: MasterTabBarControllerDelegate {
}
func masterTabBarController(_ masterTabBarController: MasterTabBarController!, needsSideMenuIconWithNotification displayNotification: Bool) {
guard BuildSettings.enableSideMenu else {
guard BWIBuildSettings.shared.enableSideMenu else {
return
}
+2 -2
View File
@@ -276,7 +276,7 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm";
return [self renderString:displayText forEvent:event];
}
} else if (event.eventType == MXEventTypeCustom) {
if (BwiBuildSettings.bwiUserLabelsTimelineEventVisible && [event.type isEqualToString:BwiBuildSettings.bwiUserLabelEventTypeString]) {
if (BWIBuildSettings.shared.bwiUserLabelsTimelineEventVisible && [event.type isEqualToString:BWIBuildSettings.shared.bwiUserLabelEventTypeString]) {
return [self bwiRenderUserLabel:event];
}
}
@@ -706,7 +706,7 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm";
{
NSString* displayName = [super senderDisplayNameForEvent:event withRoomState:roomState];
if (BwiBuildSettings.bwiUserLabelsTimelineDisplayNameVisible) {
if (BWIBuildSettings.shared.bwiUserLabelsTimelineDisplayNameVisible) {
[self.bwiUserLabelService setRoom:[mxSession vc_roomWithIdOrAlias:event.roomId]];
NSString* function = [self.bwiUserLabelService getUserLabelWithUser:event.sender];
+2 -2
View File
@@ -22,11 +22,11 @@ class MediaCompressionHelper: NSObject {
/// and the `showMediaCompressionPrompt` Riot setting.
@objc static var defaultCompressionMode: MXKRoomInputToolbarCompressionMode {
// When the compression mode build setting hasn't been customised, use the media compression prompt setting to determine what to do.
if BuildSettings.roomInputToolbarCompressionMode == .prompt {
if BWIBuildSettings.shared.roomInputToolbarCompressionMode == .prompt {
return RiotSettings.shared.showMediaCompressionPrompt ? MXKRoomInputToolbarCompressionModePrompt : MXKRoomInputToolbarCompressionModeNone
} else {
// Otherwise use the compression mode defined in the build settings.
return BuildSettings.roomInputToolbarCompressionMode.mxkCompressionMode
return BWIBuildSettings.shared.roomInputToolbarCompressionMode.mxkCompressionMode
}
}
}
+2 -2
View File
@@ -69,11 +69,11 @@
{
BOOL isUniversalLink = NO;
for (NSString *matrixPermalinkHost in BuildSettings.permalinkSupportedHosts)
for (NSString *matrixPermalinkHost in BWIBuildSettings.shared.permalinkSupportedHosts)
{
if ([url.host isEqualToString:matrixPermalinkHost])
{
NSArray<NSString*> *hostPaths = BuildSettings.permalinkSupportedHosts[matrixPermalinkHost];
NSArray<NSString*> *hostPaths = BWIBuildSettings.shared.permalinkSupportedHosts[matrixPermalinkHost];
if (hostPaths.count)
{
// iOS Patch: fix urls before using it
-1
View File
@@ -77,7 +77,6 @@ targets:
- path: ../Config
excludes:
- "AppIdentifiers.xcconfig"
- "BuildSettings.swift"
- "BuM"
- "*.sh"
- path: .
+7 -7
View File
@@ -532,7 +532,7 @@ class NotificationService: UNNotificationServiceExtension {
}
// bwi: hide content in message notifications
if BwiBuildSettings.bwiHideNotificationMessageBody {
if BWIBuildSettings.shared.bwiHideNotificationMessageBody {
// Hide the content
notificationTitle = nil
notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
@@ -613,7 +613,7 @@ class NotificationService: UNNotificationServiceExtension {
}
// bwi: hide content in other message types, too to be sure
if BwiBuildSettings.bwiHideNotificationMessageBody {
if BWIBuildSettings.shared.bwiHideNotificationMessageBody {
// Hide the content
notificationTitle = nil
notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
@@ -624,7 +624,7 @@ class NotificationService: UNNotificationServiceExtension {
notificationBody = NotificationService.localizedString(forKey: "STICKER_FROM_USER", eventSenderName)
// bwi: hide content in other message types, too to be sure
if BwiBuildSettings.bwiHideNotificationMessageBody {
if BWIBuildSettings.shared.bwiHideNotificationMessageBody {
// Hide the content
notificationTitle = nil
notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
@@ -640,7 +640,7 @@ class NotificationService: UNNotificationServiceExtension {
notificationBody = NotificationService.localizedString(forKey: "GENERIC_REACTION_FROM_USER", eventSenderName)
}
// bwi: hide content in other message types, too to be sure
if BwiBuildSettings.bwiHideNotificationMessageBody {
if BWIBuildSettings.shared.bwiHideNotificationMessageBody {
// Hide the content
notificationTitle = nil
notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
@@ -663,7 +663,7 @@ class NotificationService: UNNotificationServiceExtension {
}
}
// bwi: hide content in other message types, too to be sure
if BwiBuildSettings.bwiHideNotificationMessageBody {
if BWIBuildSettings.shared.bwiHideNotificationMessageBody {
// Hide the content
notificationTitle = nil
notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
@@ -673,7 +673,7 @@ class NotificationService: UNNotificationServiceExtension {
notificationBody = MXEventContentPollStart(fromJSON: event.content)?.question
// bwi: hide content in other message types, too to be sure
if BwiBuildSettings.bwiHideNotificationMessageBody {
if BWIBuildSettings.shared.bwiHideNotificationMessageBody {
// Hide the content
notificationTitle = nil
notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
@@ -715,7 +715,7 @@ class NotificationService: UNNotificationServiceExtension {
var validatedNotificationBody: String? = notificationBody
var validatedNotificationTitle: String? = notificationTitle
if self.localAuthenticationService.isProtectionSet || BwiBuildSettings.bwiHideNotificationMessageBody {
if self.localAuthenticationService.isProtectionSet || BWIBuildSettings.shared.bwiHideNotificationMessageBody {
MXLog.debug("[NotificationService] validateNotificationContentAndComplete: Resetting title and body because app protection is set")
validatedNotificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED")
validatedNotificationTitle = nil
+2 -2
View File
@@ -48,10 +48,10 @@ targets:
- path: ../bwi/NotificationTimes/NotificationTimesRoomSettings.swift
- path: ../bwi/NotificationTimes/NotificationTimesWeekday.swift
- path: ../bwi/NotificationTimes/Date+fromHourMinute.swift
- path: ../bwi/BwiBuildSettings.swift
- path: ../Config/BwiSettings.swift
- path: ../Riot/Managers/Settings/RiotSettings.swift
- path: ../Config/BuildSettings.swift
- path: ../Config/BWIBuildSettings.swift
- path: ../Config/BuM/BWIBuildSettings+BuM.swift
- path: ../bwi/UserAgent/UserAgentService.swift
- path: ../Riot/Utils/DataProtectionHelper.swift
- path: ../Config/CommonConfiguration.swift
+2 -2
View File
@@ -43,13 +43,13 @@ targets:
- path: ../bwi/SecureStorage
- path: ../bwi/ServerURLs
- path: ../bwi/AppConfig
- path: ../bwi/BwiBuildSettings.swift
- path: ../Config/BwiSettings.swift
- path: ../Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m
- path: ../Riot/Categories/Bundle.swift
- path: ../Riot/Managers/Theme/
- path: ../Riot/Utils/AvatarGenerator.m
- path: ../Config/BuildSettings.swift
- path: ../Config/BWIBuildSettings.swift
- path: ../Config/BuM/BWIBuildSettings+BuM.swift
- path: ../bwi/UserAgent/UserAgentService.swift
- path: ../Riot/Categories/Character.swift
- path: ../Riot/Categories/MXKImageView.swift
@@ -54,7 +54,7 @@ final class AnalyticsPromptCoordinator: Coordinator, Presentable {
promptType = .newUser
}
let viewModel = AnalyticsPromptViewModel(promptType: promptType, strings: strings, termsURL: BuildSettings.analyticsConfiguration.termsURL)
let viewModel = AnalyticsPromptViewModel(promptType: promptType, strings: strings, termsURL: BWIBuildSettings.shared.analyticsConfiguration.termsURL)
let view = AnalyticsPrompt(viewModel: viewModel.context)
_analyticsPromptViewModel = viewModel
@@ -109,8 +109,8 @@ class AuthenticationService: NSObject {
// not logged in
// update the state with given HS and IS addresses
state = AuthenticationState(flow: flow,
homeserverAddress: hsUrl ?? BuildSettings.serverConfigDefaultHomeserverUrlString,
identityServer: isUrl ?? BuildSettings.serverConfigDefaultIdentityServerUrlString)
homeserverAddress: hsUrl ?? BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString,
identityServer: isUrl ?? BWIBuildSettings.shared.serverConfigDefaultIdentityServerUrlString)
// store the link to override the default homeserver address.
provisioningLink = universalLink
@@ -143,7 +143,7 @@ class AuthenticationService: NSObject {
/// - homeserverAddress: The homeserver to start the flow for, or `nil` to use the default.
/// If a provisioning link has been set, it will override the default homeserver when passing `nil`.
func startFlow(_ flow: AuthenticationFlow, for homeserverAddress: String? = nil) async throws {
let address = homeserverAddress ?? provisioningLink?.homeserverUrl ?? BuildSettings.serverConfigDefaultHomeserverUrlString
let address = homeserverAddress ?? provisioningLink?.homeserverUrl ?? BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString
var (client, homeserver) = try await loginFlow(for: address)
@@ -197,7 +197,7 @@ class AuthenticationService: NSObject {
// This address will be replaced when `startFlow` is called, but for
// completeness revert to the default homeserver if requested anyway.
let address = useDefaultServer ? BuildSettings.serverConfigDefaultHomeserverUrlString : state.homeserver.addressFromUser ?? state.homeserver.address
let address = useDefaultServer ? BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString : state.homeserver.addressFromUser ?? state.homeserver.address
let identityServer = state.identityServer
state = AuthenticationState(flow: .login,
homeserverAddress: address,
@@ -28,7 +28,7 @@ struct PrimaryActionButtonStyle: ButtonStyle {
}
private var backgroundColor: Color {
if BwiBuildSettings.bwiEnableBuMUI {
if BWIBuildSettings.shared.bwiEnableBuMUI {
return Color(hex: 0x108194)
} else {
return customColor ?? theme.colors.accent
@@ -27,7 +27,7 @@ class LiveLocationSharingViewerViewModelTests: XCTestCase {
override func setUpWithError() throws {
service = MockLiveLocationSharingViewerService()
viewModel = LiveLocationSharingViewerViewModel(mapStyleURL: BuildSettings.defaultTileServerMapStyleURL, service: service)
viewModel = LiveLocationSharingViewerViewModel(mapStyleURL: BWIBuildSettings.shared.defaultTileServerMapStyleURL, service: service)
context = viewModel.context
}
}
@@ -49,7 +49,7 @@ struct StaticLocationViewingViewState: BindableState {
}
var shareButtonVisible: Bool {
BwiBuildSettings.bwiLocationShareButtonVisible
BWIBuildSettings.shared.bwiLocationShareButtonVisible
}
let errorSubject = PassthroughSubject<LocationSharingViewError, Never>()
@@ -62,7 +62,7 @@ struct StaticLocationView: View {
}
.disabled(!viewModel.viewState.shareButtonEnabled)
.accessibilityIdentifier("shareButton")
.opacity(BwiBuildSettings.bwiLocationShareButtonVisible ? 1.0 : 0.0)
.opacity(BWIBuildSettings.shared.bwiLocationShareButtonVisible ? 1.0 : 0.0)
}
}
.navigationBarTitleDisplayMode(.inline)
@@ -93,7 +93,7 @@ struct OnboardingSplashScreen: View {
/// The main action buttons.
var buttons: some View {
VStack(spacing: 12) {
if BwiBuildSettings.bwiOnboardingSplashScreenEnableRegister {
if BWIBuildSettings.shared.bwiOnboardingSplashScreenEnableRegister {
Button { viewModel.send(viewAction: .register) } label: {
Text(VectorL10n.onboardingSplashRegisterButtonTitle)
}
@@ -27,7 +27,7 @@ struct PollEditFormTypePicker: View {
.font(theme.fonts.title3SB)
.foregroundColor(theme.colors.primaryContent)
PollEditFormTypeButton(type: .disclosed, selectedType: $selectedType)
if BwiBuildSettings.bwiShowClosedPolls {
if BWIBuildSettings.shared.bwiShowClosedPolls {
PollEditFormTypeButton(type: .undisclosed, selectedType: $selectedType)
}
}
@@ -32,7 +32,7 @@ extension NotificationSettingsScreen: Identifiable {
extension NotificationSettingsScreen {
/// Defines which rules are handled by each of the screens.
var pushRules: [NotificationPushRuleId] {
if BuildSettings.settingsNotificationsBWIDefaultSet {
if BWIBuildSettings.shared.settingsNotificationsBWIDefaultSet {
switch self {
case .defaultNotifications:
return [.oneToOneEncryptedRoom, .encrypted, .inviteMe]
+2
View File
@@ -51,6 +51,8 @@ targets:
- path: ../Riot/Managers/Theme/
- path: ../Riot/Managers/Locale/LocaleProviderType.swift
- path: ../Config/BuildSettings.swift
- path: ../Config/BWIBuildSettings.swift
- path: ../Config/BuM/BWIBuildSettings+BuM.swift
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
- path: ../Riot/Categories/String.swift
- path: ../Riot/Categories/Character.swift
+2
View File
@@ -60,6 +60,8 @@ targets:
- path: ../Riot/Managers/Theme/
- path: ../Riot/Managers/Locale/LocaleProviderType.swift
- path: ../Config/BuildSettings.swift
- path: ../Config/BWIBuildSettings.swift
- path: ../Config/BuM/BWIBuildSettings+BuM.swift
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
- path: ../Riot/Categories/String.swift
- path: ../Riot/Categories/Character.swift
@@ -91,7 +91,7 @@ import XCTest
service.reset(useDefaultServer: true)
// Then the service should reset back to the default server.
XCTAssertEqual(service.state.homeserver.address, BuildSettings.serverConfigDefaultHomeserverUrlString,
XCTAssertEqual(service.state.homeserver.address, BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString,
"The address should reset to the value configured in the build settings.")
}
@@ -124,7 +124,7 @@ import XCTest
// Then the link should be forgotten.
XCTAssertNil(service.provisioningLink, "The provisioning link should be forgotten after resetting back to the default server.")
XCTAssertNil(service.state.homeserver.addressFromUser, "There shouldn't be an address from the user after resetting the service.")
XCTAssertEqual(service.state.homeserver.address, BuildSettings.serverConfigDefaultHomeserverUrlString,
XCTAssertEqual(service.state.homeserver.address, BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString,
"The address should reset to the value configured in the build settings.")
}
+2 -2
View File
@@ -60,8 +60,8 @@ targets:
- path: .
- path: ../Config/Configurable.swift
- path: ../Config/BuildSettings.swift
- path: ../bwi/BwiBuildSettings.swift
- path: ../Config/BwiSettings.swift
- path: ../Config/BWIBuildSettings.swift
- path: ../Config/BuM/BWIBuildSettings+BuM.swift
- path: ../Config/AppConfiguration.swift
- path: ../Config/CommonConfiguration.swift
- path: ../Riot/Categories/Bundle.swift
+2
View File
@@ -44,6 +44,8 @@ targets:
- path: ../Riot/Categories/Bundle.swift
- path: ../Config/CommonConfiguration.swift
- path: ../Config/BuildSettings.swift
- path: ../Config/BWIBuildSettings.swift
- path: ../Config/BuM/BWIBuildSettings+BuM.swift
- path: ../Config/Configurable.swift
- path: ../Riot/Managers/Settings/RiotSettings.swift
- path: ../Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift
+3 -3
View File
@@ -141,7 +141,7 @@ extension UserDefaults
} else if let url = ServerURLHelper.shared.serverUrl() {
return url
} else {
return BuildSettings.serverConfigDefaultHomeserverUrlString
return BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString
}
}
@@ -151,7 +151,7 @@ extension UserDefaults
} else if let url = ServerURLHelper.shared.pusherUrl() {
return url
} else {
return BuildSettings.serverConfigSygnalAPIUrlString
return BWIBuildSettings.shared.serverConfigSygnalAPIUrlString
}
}
@@ -173,7 +173,7 @@ extension UserDefaults
} else if let url = ServerURLHelper.shared.analytics() {
return url
} else {
return BuildSettings.bwiAnalyticsServerUrlString
return BWIBuildSettings.shared.bwiAnalyticsServerUrlString
}
}
}
-139
View File
@@ -1,139 +0,0 @@
//
/*
* Copyright (c) 2021 BWI GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Foundation
@objcMembers
final class BwiBuildSettings: NSObject {
// Integration check
static let forcedPinProtection = true
// Jailbreak check
static let forcedNoneJailbroken = true
/// Default number of iterations for secure storage. Do not change this value after going live.
static let iterationsForSecureStorage: UInt = 100000
/// Allow split view detail view stacking
static let allowSplitViewDetailsScreenStacking: Bool = true
// direct rooms are for two persons only in bwi context
static let allowInviteOnDirectRooms: Bool = false
// test setup for downtime: should be false for all builds
static let useTestDataForDowntime: Bool = false
static let flavor = ""
static let showBwiSplashScreen: Bool = false
static let bwiShowRoomSearch: Bool = false
static let bwiAllowRoomPermalink: Bool = false
static let bwiAllowUserPermalink: Bool = false
static let bwiCheckAppVersion = true
static let bwiSettingsShowSecureBackupSection = false
static let bwiSettingsShowCrossSigningSection = false
static let bwiNotificationTimes = true
static let bwiUserLabelsAdminSettingsVisible = true
static let bwiUserLabelsMemberDetailsVisible = true
static let bwiUserLabelsParticipantsVisible = true
static let bwiUserLabelsTimelineDisplayNameVisible = true
static let bwiUserLabelsTimelineEventVisible = true
static let bwiUserLabelEventTypeString = "de.bwi.room.user_function_labels"
static let bwiUserLabelParticipantSorting = true
static let bwiShowClosedPolls = true
static let bwiShowThreads = false
static let bwiShowRoomCreationSectionFooter = false
static let bwiAutoCreateAliasOnRoomCreation = true
static let bwiLocationShareButtonVisible = true
static let bwiUseCustomPersonalNotesAvatar = true
static let bwiBetterIgnoredUsers = true
static let bwiSettingsShowInAppNotifications = false
static let bwiFilteredContextMenu = true
static let bwiShowPinnedNotificationSettings = false
static let bwiShowSessionSettingsFooter = false
static let bwiEnablePersonalState = false
// In onboarding splash screen dis/enable register button
static let bwiOnboardingSplashScreenEnableRegister = false
// make sure that the NSE extention always resets message body and title
static let bwiHideNotificationMessageBody = true
// in Auth screen dis/enable register button even with onboarding splash screen enabled
static let bwiAuthentificationScreenEnableRegister = false
// enable BuM style authentication UI (more Info text and a logo)
static let bwiEnableBuMAuthentificationUI = true
// voicemessages should resignplaying when the app enters the background
static let bwiResignPlayingVoiceMessageInBackground = true
// enable BUM style UI in pincode and maybe other places
static let bwiEnableBuMUI = true
// clear media cache every time when leaving a room vc: no media should be saved on device for security purposes
static let bwiClearMediaCacheOnRoomExit = true
static let bwiEnableLoginProtection = true
static let bwiHashes = [ "a3f65e35a7476799afe8d80282fb3c45b39dab06d0d8c70dc98e45ab7d8e93a9",
"2fda1a831655c22a5e6096d7cfbff4429fbf27881141e191b46adbf168142a11",
"4f8cbb3fef885f7284d0477d797d7007f0e1ba76221834132652f4d645796e28",
"24c2ec541e61e8e68941b96dc45ed5df12f6bdbda283cb0b3a322742aa970256",
"1be0b314a6c915d4475290522baef5b642db1b6d68937992b8e0eb5b7b0d6666" ]
// use a different badge color if the user was mentioned in a room
static let showMentionsInRoom = true
// replace feature history link variable with the appropiate build setting
static let bwiFeatureHistoryLink = "https://messenger.bwi.de/#c4783"
static let bwiReplaceFeatureLink = true
// login with matrix id should only be enabled in some configurations
static let bwiEnableLoginWithMatrixID = true
// show app specific loading icons instead of the rotating element logo
static let showBUMLottieAnimation = true
// DMs don't need all roomsettings (like changing avatar, name, topic)
static let showUnrelatedRoomSettingsForDirectMessages = false
// create rooms without shared history
static let enableSharedHistoryOnRoomCreation = false
// explicitly set sdk option for key sharing => We don't want to share even if the room setting allows it
static let allowKeySharingOnRoomInvite = true
// DMs don't need all roomsettings (like changing avatar, name, topic)
static let allowDoubleTapOnImageAttachmentsForZoom = true
}
+3 -3
View File
@@ -48,13 +48,13 @@ import MatomoTracker
appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as! String
appVersion = AppDelegate.theDelegate().appVersion
if BuildSettings.bwiEnableErrorTracking {
if BWIBuildSettings.shared.bwiEnableErrorTracking {
guard let url = URL(string: AppConfigService.shared.analyticsUrl()) else {
matomo = nil
return
}
matomo = MatomoTracker.init(siteId: BuildSettings.bwiAnalyticsAppId, baseURL:url, userAgent: nil)
matomo = MatomoTracker.init(siteId: BWIBuildSettings.shared.bwiAnalyticsAppId, baseURL:url, userAgent: nil)
matomo?.isOptedOut = false
@@ -72,7 +72,7 @@ import MatomoTracker
}
func needsToShowPromt() -> Bool {
if !BuildSettings.bwiEnableErrorTracking {
if !BWIBuildSettings.shared.bwiEnableErrorTracking {
return false
}
+2 -2
View File
@@ -54,8 +54,8 @@ class SecureFileStorage {
do {
try memoryVault.set(makeSalt(), forKey: saltKeyName)
dict[saltKeyName] = makeSalt().data(using: .utf8)
try memoryVault.set(BwiBuildSettings.iterationsForSecureStorage, forKey: iterationsKeyName)
dict[iterationsKeyName] = String(BwiBuildSettings.iterationsForSecureStorage).data(using: .utf8)
try memoryVault.set(BWIBuildSettings.shared.iterationsForSecureStorage, forKey: iterationsKeyName)
dict[iterationsKeyName] = String(BWIBuildSettings.shared.iterationsForSecureStorage).data(using: .utf8)
saveToFile()
} catch {
+1 -1
View File
@@ -20,7 +20,7 @@ import Foundation
@objcMembers class IntegrityCheck : NSObject, SecurityCheck {
func isBreached() -> Bool {
return (BwiBuildSettings.forcedPinProtection && !PinCodePreferences.shared.isPinSet)
return (BWIBuildSettings.shared.forcedPinProtection && !PinCodePreferences.shared.isPinSet)
}
func breachAlert() -> UIAlertController {
+1 -1
View File
@@ -21,7 +21,7 @@ import DTTJailbreakDetection
@objcMembers class JailbreakCheck : NSObject, SecurityCheck {
func isBreached() -> Bool {
if BwiBuildSettings.forcedNoneJailbroken {
if BWIBuildSettings.shared.forcedNoneJailbroken {
return DTTJailbreakDetection.isJailbroken()
}
return false
@@ -43,7 +43,7 @@ final class OnboardingBwiSplashScreenCoordinator: OnboardingBwiSplashScreenCoord
let viewModel = OnboardingBwiSplashScreenViewModel()
onboardingSplashScreenViewModel = viewModel
if BwiBuildSettings.showBUMLottieAnimation {
if BWIBuildSettings.shared.showBUMLottieAnimation {
onboardingSplashScreenHostingController = BUMLaunchLoadingViewController()
} else {
let view = OnboardingBwiSplashScreen(viewModel: viewModel.context)
@@ -61,7 +61,7 @@ final class OnboardingBwiSplashScreenCoordinator: OnboardingBwiSplashScreenCoord
// MARK: - Public
func start() {
if BwiBuildSettings.showBUMLottieAnimation {
if BWIBuildSettings.shared.showBUMLottieAnimation {
timer?.invalidate()
timer = Timer.scheduledTimer(withTimeInterval: 5, repeats: false) { timer in
timer.invalidate()
+2 -2
View File
@@ -24,11 +24,11 @@ class BWIAnalyticsTests: XCTestCase {
// So we must check that host and key is not set in the BuildSettings.
func testAnalyticsHost() throws {
XCTAssertNil(BuildSettings.analyticsHost)
XCTAssertNil(BWIBuildSettings.shared.analyticsHost)
}
func testAnalyticsKey() throws {
XCTAssertNil(BuildSettings.analyticsKey)
XCTAssertNil(BWIBuildSettings.shared.analyticsKey)
}
}

Some files were not shown because too many files have changed in this diff Show More