Unverified Commit cafed69c authored by Gil Eluard's avatar Gil Eluard Committed by GitHub
Browse files

Merge pull request #4243 from vector-im/element_4242

Show/Hide public directory in Unified Search
parents 9620cee9 a61cc09e
......@@ -7,6 +7,7 @@ Changes to be released in next version
🙌 Improvements
* MasterTabBarController: Show/Hide Home Screen tabs (#4234).
* RoomVC: Enable / Disable VoIP feature in Rooms (#4236).
* UnifiedSearchRecentsDataSource: Show/Hide public directory (#4242).
🐛 Bugfix
*
......
......@@ -291,4 +291,7 @@ final class BuildSettings: NSObject {
static let authScreenShowPhoneNumber = true
static let authScreenShowForgotPassword = true
static let authScreenShowCustomServerOptions = true
// Mark: - Unified Search
static let unifiedSearchScreenShowPublicDirectory = true
}
......@@ -58,6 +58,7 @@ final class RiotSettings: NSObject {
static let homeScreenShowCommunitiesTab = "homeScreenShowCommunitiesTab"
static let roomScreenAllowVoIPForDirectRoom = "roomScreenAllowVoIPForDirectRoom"
static let roomScreenAllowVoIPForNonDirectRoom = "roomScreenAllowVoIPForNonDirectRoom"
static let unifiedSearchScreenShowPublicDirectory = "unifiedSearchScreenShowPublicDirectory"
}
static let shared = RiotSettings()
......@@ -472,4 +473,18 @@ final class RiotSettings: NSObject {
defaults.set(newValue, forKey: UserDefaultsKeys.settingsSecurityScreenShowAdvancedUnverifiedDevices)
}
}
// Mark: - Unified Search
var unifiedSearchScreenShowPublicDirectory: Bool {
get {
guard defaults.object(forKey: UserDefaultsKeys.unifiedSearchScreenShowPublicDirectory) != nil else {
return BuildSettings.unifiedSearchScreenShowPublicDirectory
}
return defaults.bool(forKey: UserDefaultsKeys.unifiedSearchScreenShowPublicDirectory)
} set {
defaults.set(newValue, forKey: UserDefaultsKeys.unifiedSearchScreenShowPublicDirectory)
}
}
}
......@@ -22,6 +22,7 @@
#import "DirectoryRecentTableViewCell.h"
#import "MXRoom+Riot.h"
#import "Riot-Swift.h"
@interface UnifiedSearchRecentsDataSource()
{
......@@ -85,7 +86,10 @@
}
// The public rooms directory cell is then visible whatever the search activity.
self.directorySection = sectionsOffset++;
if (RiotSettings.shared.unifiedSearchScreenShowPublicDirectory)
{
self.directorySection = sectionsOffset++;
}
if (_hideRecents)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment