mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Security and privacy part 1 (#3617)
* added the security and settings button in details * added content to the view * added enable encryption alert * updated preview tests and the UI * removed wrong plists committed by mistake * pr suggestions
This commit is contained in:
@@ -31,6 +31,7 @@ enum RoomDetailsScreenCoordinatorAction {
|
||||
case presentPinnedEventsTimeline
|
||||
case presentMediaEventsTimeline
|
||||
case presentKnockingRequestsListScreen
|
||||
case presentSecurityAndPrivacyScreen
|
||||
}
|
||||
|
||||
final class RoomDetailsScreenCoordinator: CoordinatorProtocol {
|
||||
@@ -85,6 +86,8 @@ final class RoomDetailsScreenCoordinator: CoordinatorProtocol {
|
||||
actionsSubject.send(.presentMediaEventsTimeline)
|
||||
case .displayKnockingRequests:
|
||||
actionsSubject.send(.presentKnockingRequestsListScreen)
|
||||
case .displaySecurityAndPrivacy:
|
||||
actionsSubject.send(.presentSecurityAndPrivacyScreen)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
@@ -24,6 +24,7 @@ enum RoomDetailsScreenViewModelAction {
|
||||
case displayPinnedEventsTimeline
|
||||
case displayMediaEventsTimeline
|
||||
case displayKnockingRequests
|
||||
case displaySecurityAndPrivacy
|
||||
}
|
||||
|
||||
// MARK: View
|
||||
@@ -56,6 +57,10 @@ struct RoomDetailsScreenViewState: BindableState {
|
||||
knockingEnabled && dmRecipient == nil && isKnockableRoom && (canInviteUsers || canKickUsers || canBanUsers)
|
||||
}
|
||||
|
||||
var canSeeSecurityAndPrivacy: Bool {
|
||||
knockingEnabled && dmRecipient == nil && canEditRolesOrPermissions
|
||||
}
|
||||
|
||||
var mediaBrowserEnabled = false
|
||||
|
||||
var canEdit: Bool {
|
||||
@@ -198,6 +203,7 @@ enum RoomDetailsScreenViewAction {
|
||||
case processTapPolls
|
||||
case toggleFavourite(isFavourite: Bool)
|
||||
case processTapRolesAndPermissions
|
||||
case processTapSecurityAndPrivacy
|
||||
case processTapCall
|
||||
case processTapPinnedEvents
|
||||
case processTapMediaEvents
|
||||
|
||||
@@ -172,6 +172,8 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
actionsSubject.send(.displayMediaEventsTimeline)
|
||||
case .processTapRequestsToJoin:
|
||||
actionsSubject.send(.displayKnockingRequests)
|
||||
case .processTapSecurityAndPrivacy:
|
||||
actionsSubject.send(.displaySecurityAndPrivacy)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,14 @@ struct RoomDetailsScreen: View {
|
||||
.onChange(of: context.isFavourite) { _, newValue in
|
||||
context.send(viewAction: .toggleFavourite(isFavourite: newValue))
|
||||
}
|
||||
|
||||
if context.viewState.canSeeSecurityAndPrivacy {
|
||||
ListRow(label: .default(title: L10n.screenRoomDetailsSecurityAndPrivacyTitle,
|
||||
icon: \.lock),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .processTapSecurityAndPrivacy)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user