Unverified Commit 873aa9fd authored by SBiOSoftWhare's avatar SBiOSoftWhare Committed by GitHub
Browse files

Merge branch 'develop' into fix_public_search

parents dff2a7ea 2cfe9441
......@@ -5,7 +5,10 @@ Changes to be released in next version
*
🙌 Improvements
* Add `gitter.im` to list of default room directories
* MasterTabBarController: Show/Hide Home Screen tabs (#4234).
* RoomVC: Enable / Disable VoIP feature in Rooms (#4236).
* UnifiedSearchRecentsDataSource: Show/Hide public directory (#4242).
* DirectoryRecentTableViewCell: Do not use "directory_search_results_more_than" string when there is no rooms and the search is on.
🐛 Bugfix
......
......@@ -150,7 +150,8 @@ final class BuildSettings: NSObject {
static let publicRoomsAllowServerChange: Bool = true
// List of homeservers for the public rooms directory
static let publicRoomsDirectoryServers = [
"matrix.org"
"matrix.org",
"gitter.im"
]
......@@ -256,6 +257,11 @@ final class BuildSettings: NSObject {
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
// MARK: - Room Settings Screen
......@@ -286,4 +292,7 @@ final class BuildSettings: NSObject {
static let authScreenShowPhoneNumber = true
static let authScreenShowForgotPassword = true
static let authScreenShowCustomServerOptions = true
// Mark: - Unified Search
static let unifiedSearchScreenShowPublicDirectory = true
}
......@@ -56,6 +56,9 @@ final class RiotSettings: NSObject {
static let homeScreenShowPeopleTab = "homeScreenShowPeopleTab"
static let homeScreenShowRoomsTab = "homeScreenShowRoomsTab"
static let homeScreenShowCommunitiesTab = "homeScreenShowCommunitiesTab"
static let roomScreenAllowVoIPForDirectRoom = "roomScreenAllowVoIPForDirectRoom"
static let roomScreenAllowVoIPForNonDirectRoom = "roomScreenAllowVoIPForNonDirectRoom"
static let unifiedSearchScreenShowPublicDirectory = "unifiedSearchScreenShowPublicDirectory"
}
static let shared = RiotSettings()
......@@ -246,6 +249,29 @@ final class RiotSettings: NSObject {
}
}
// MARK: - Room Screen
var roomScreenAllowVoIPForDirectRoom: Bool {
get {
guard defaults.object(forKey: UserDefaultsKeys.roomScreenAllowVoIPForDirectRoom) != nil else {
return BuildSettings.roomScreenAllowVoIPForDirectRoom
}
return defaults.bool(forKey: UserDefaultsKeys.roomScreenAllowVoIPForDirectRoom)
} set {
defaults.set(newValue, forKey: UserDefaultsKeys.roomScreenAllowVoIPForDirectRoom)
}
}
var roomScreenAllowVoIPForNonDirectRoom: Bool {
get {
guard defaults.object(forKey: UserDefaultsKeys.roomScreenAllowVoIPForNonDirectRoom) != nil else {
return BuildSettings.roomScreenAllowVoIPForNonDirectRoom
}
return defaults.bool(forKey: UserDefaultsKeys.roomScreenAllowVoIPForNonDirectRoom)
} set {
defaults.set(newValue, forKey: UserDefaultsKeys.roomScreenAllowVoIPForNonDirectRoom)
}
}
// MARK: - Room Creation Screen
var roomCreationScreenAllowEncryptionConfiguration: Bool {
......@@ -447,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)
{
......
......@@ -1400,7 +1400,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
- (BOOL)supportCallOption
{
return BuildSettings.allowVoIPUsage && self.roomDataSource.mxSession.callManager && self.roomDataSource.room.summary.membersCount.joined >= 2;
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;
}
- (BOOL)isCallActive
......
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