Skip to content

Commit

Permalink
Merge pull request #6373 from vector-im/aringenbach/6273_delete_riot_…
Browse files Browse the repository at this point in the history
…defaults

Remove legacy Riot-Defaults property list
  • Loading branch information
aringenbach authored Jul 5, 2022
2 parents 8e45629 + 837bf0b commit 3330938
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 131 deletions.
13 changes: 13 additions & 0 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,17 @@ final class BuildSettings: NSObject {
static let tileServerMapStyleURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx")!

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
}
38 changes: 0 additions & 38 deletions Riot/Assets/Riot-Defaults.plist

This file was deleted.

73 changes: 0 additions & 73 deletions Riot/Generated/RiotDefaults.swift

This file was deleted.

28 changes: 18 additions & 10 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -4375,16 +4375,24 @@ - (void)gdprConsentViewControllerDidConsentToGDPRWithSuccess:(GDPRConsentViewCon

- (void)setupUserDefaults
{
// Register "Riot-Defaults.plist" default values
NSString* userDefaults = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UserDefaults"];
NSString *defaultsPathFromApp = [[NSBundle mainBundle] pathForResource:userDefaults ofType:@"plist"];
NSMutableDictionary *defaults = [[NSDictionary dictionaryWithContentsOfFile:defaultsPathFromApp] mutableCopy];

// add pusher ids, as they don't belong to plist anymore
defaults[@"pushKitAppIdProd"] = BuildSettings.pushKitAppIdProd;
defaults[@"pushKitAppIdDev"] = BuildSettings.pushKitAppIdDev;
defaults[@"pusherAppIdProd"] = BuildSettings.pusherAppIdProd;
defaults[@"pusherAppIdDev"] = BuildSettings.pusherAppIdDev;
// Register MatrixKit defaults.
NSDictionary *defaults = @{
@"enableBotCreation": @(BuildSettings.enableBotCreation),
@"maxAllowedMediaCacheSize": @(BuildSettings.maxAllowedMediaCacheSize),
@"presenceColorForOfflineUser": @(BuildSettings.presenceColorForOfflineUser),
@"presenceColorForOnlineUser": @(BuildSettings.presenceColorForOnlineUser),
@"presenceColorForUnavailableUser": @(BuildSettings.presenceColorForUnavailableUser),
@"showAllEventsInRoomHistory": @(BuildSettings.showAllEventsInRoomHistory),
@"showLeftMembersInRoomMemberList": @(BuildSettings.showLeftMembersInRoomMemberList),
@"showRedactionsInRoomHistory": @(BuildSettings.showRedactionsInRoomHistory),
@"showUnsupportedEventsInRoomHistory": @(BuildSettings.showUnsupportedEventsInRoomHistory),
@"sortRoomMembersUsingLastSeenTime": @(BuildSettings.syncLocalContacts),
@"syncLocalContacts": @(BuildSettings.syncLocalContacts),
@"pushKitAppIdProd": BuildSettings.pushKitAppIdProd,
@"pushKitAppIdDev": BuildSettings.pushKitAppIdDev,
@"pusherAppIdProd": BuildSettings.pusherAppIdProd,
@"pusherAppIdDev": BuildSettings.pusherAppIdDev
};

[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];

Expand Down
2 changes: 0 additions & 2 deletions Riot/SupportingFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@
<string>im.vector.app.pills</string>
</dict>
</array>
<key>UserDefaults</key>
<string>${PRODUCT_NAME}-Defaults</string>
<key>applicationGroupIdentifier</key>
<string>$(APPLICATION_GROUP_IDENTIFIER)</string>
<key>baseBundleIdentifier</key>
Expand Down
9 changes: 1 addition & 8 deletions Tools/SwiftGen/swiftgen-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,4 @@ xcassets:
- Assets/SharedImages.xcassets
outputs:
templatePath: Templates/Assets/swift4-element.stencil
output: Images.swift
plist:
inputs: Assets/Riot-Defaults.plist
outputs:
templateName: runtime-swift4
output: RiotDefaults.swift
params:
enumName: RiotDefaults
output: Images.swift
1 change: 1 addition & 0 deletions changelog.d/6273.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove legacy Riot-Defaults property list

0 comments on commit 3330938

Please sign in to comment.