Direct Message: manage encrypted DM in case of invite by email

- Don’t allow to invite more than one contact by email
- The DM will be created by enabling the encryption when the HS promotes the encryption
- The chat composer is disabled until a matrix account is created by using the invited email
This commit is contained in:
Nicolas Mauri
2023-02-21 12:23:34 +01:00
parent 60ede32dc6
commit de2819ae60
10 changed files with 339 additions and 17 deletions
@@ -31,6 +31,7 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
private let parentSpaceId: String?
private let initialSection: RoomInfoSection
private let dismissOnCancel: Bool
private let canAddParticipants: Bool
private weak var roomSettingsViewController: RoomSettingsViewController?
private lazy var segmentedViewController: SegmentedViewController = {
@@ -43,6 +44,8 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
participants.parentSpaceId = self.parentSpaceId
participants.delegate = self
participants.screenTracker = AnalyticsScreenTracker(screen: .roomMembers)
participants.showInviteUserFab = self.canAddParticipants
let files = RoomFilesViewController()
files.finalizeInit()
@@ -105,6 +108,7 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
self.room = parameters.room
self.parentSpaceId = parameters.parentSpaceId
self.initialSection = parameters.initialSection
self.canAddParticipants = parameters.canAddParticipants
self.dismissOnCancel = parameters.dismissOnCancel
}
@@ -33,12 +33,14 @@ class RoomInfoCoordinatorParameters: NSObject {
let parentSpaceId: String?
let initialSection: RoomInfoSection
let dismissOnCancel: Bool
let canAddParticipants: Bool
init(session: MXSession, room: MXRoom, parentSpaceId: String?, initialSection: RoomInfoSection, dismissOnCancel: Bool) {
init(session: MXSession, room: MXRoom, parentSpaceId: String?, initialSection: RoomInfoSection, canAddParticipants: Bool = true, dismissOnCancel: Bool) {
self.session = session
self.room = room
self.parentSpaceId = parentSpaceId
self.initialSection = initialSection
self.canAddParticipants = canAddParticipants
self.dismissOnCancel = dismissOnCancel
super.init()
}
@@ -50,4 +52,8 @@ class RoomInfoCoordinatorParameters: NSObject {
convenience init(session: MXSession, room: MXRoom, parentSpaceId: String?, initialSection: RoomInfoSection) {
self.init(session: session, room: room, parentSpaceId: parentSpaceId, initialSection: initialSection, dismissOnCancel: false)
}
convenience init(session: MXSession, room: MXRoom, parentSpaceId: String?, initialSection: RoomInfoSection, canAddParticipants: Bool) {
self.init(session: session, room: room, parentSpaceId: parentSpaceId, initialSection: initialSection, canAddParticipants: canAddParticipants, dismissOnCancel: false)
}
}