Merge pull request #6098 from vector-im/yostyle/disable_search_encrypted_rooms

Hide or disable search in the encrypted rooms
This commit is contained in:
Yoan Pintas
2022-05-16 23:24:06 +02:00
committed by GitHub
4 changed files with 9 additions and 1 deletions
@@ -159,6 +159,7 @@ final class RoomInfoListViewController: UIViewController {
// MARK: - Private
private func updateSections(with viewData: RoomInfoListViewData) {
isRoomDirect = viewData.isDirect
basicInfoView.configure(withViewData: viewData.basicInfoViewData)
var tmpSections: [Section] = []
@@ -193,7 +194,9 @@ final class RoomInfoListViewController: UIViewController {
}
rows.append(rowMembers)
rows.append(rowUploads)
rows.append(rowSearch)
if !viewData.isEncrypted {
rows.append(rowSearch)
}
let sectionSettings = Section(header: VectorL10n.roomInfoListSectionOther,
rows: rows,
@@ -21,5 +21,7 @@ import Foundation
/// View data object to represent view
struct RoomInfoListViewData {
let numberOfMembers: Int
let isEncrypted: Bool
let isDirect: Bool
let basicInfoViewData: RoomInfoBasicViewData
}
@@ -49,6 +49,8 @@ final class RoomInfoListViewModel: NSObject, RoomInfoListViewModelType {
directUserPresence: directUserPresence)
return RoomInfoListViewData(numberOfMembers: Int(room.summary.membersCount.joined),
isEncrypted: room.summary.isEncrypted,
isDirect: room.isDirect,
basicInfoViewData: basicInfoViewData)
}