Skip to content

Commit

Permalink
Display the option "Share invite link" only when the room is accessib…
Browse files Browse the repository at this point in the history
…le by link (#6496)
  • Loading branch information
Philippe Loriaux committed Aug 18, 2022
1 parent 3c4af39 commit c921a76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@ import Foundation
class RoomInviteViewController: ContactsTableViewController {

var room: MXRoom?
var roomAlias: String?
private var roomAlias: String?
private var joinRule: MXRoomJoinRule?

private lazy var shareLinkPresenter: ShareInviteLinkPresenter = ShareInviteLinkPresenter()

override func viewDidLoad() {
super.viewDidLoad()

roomAlias = room?.summary?.aliases?.first
joinRule = MXRoomJoinRule(identifier: room?.summary?.joinRule)
setupShareInviteLinkHeader()
}

private func setupShareInviteLinkHeader() {
guard roomAlias != nil, RiotSettings.shared.allowInviteExernalUsers else {
guard roomAlias != nil,
RiotSettings.shared.allowInviteExernalUsers,
joinRule != .invite,
joinRule != .restricted else {
contactsTableView.tableHeaderView = nil
return
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6496.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Display the option "Share invite link" only when the room is accessible by link.

0 comments on commit c921a76

Please sign in to comment.