Feature/2581 permalinks

This commit is contained in:
Frank Rotermund
2022-03-31 05:51:40 +00:00
parent d0203ecec4
commit 61d260a8e0
17 changed files with 168 additions and 29 deletions

View File

@@ -18,6 +18,7 @@
*/
import UIKit
import MatrixSDK
final class RoomInfoListViewController: UIViewController {
@@ -204,6 +205,10 @@ final class RoomInfoListViewController: UIViewController {
let rowSearch = Row(type: .default, icon: Asset.Images.searchIcon.image, text: VectorL10n.roomDetailsSearch, accessoryType: .disclosureIndicator) {
self.viewModel.process(viewAction: .navigate(target: .search))
}
let rowPermalink = Row(type: .default, icon: nil, text: VectorL10n.roomDetailsPermalink, accessoryType: .none) {
self.viewModel.process(viewAction: .permalink)
}
let rowIntegrations = Row(type: .default, icon: Asset.Images.integrationsIcon.image, text: VectorL10n.roomDetailsIntegrations, accessoryType: .disclosureIndicator) {
self.viewModel.process(viewAction: .navigate(target: .integrations))
@@ -222,7 +227,14 @@ final class RoomInfoListViewController: UIViewController {
}
rows.append(rowMembers)
rows.append(rowUploads)
rows.append(rowSearch)
if BwiBuildSettings.bwiShowRoomSearch {
rows.append(rowSearch)
}
if BwiBuildSettings.bwiAllowRoomPermalink {
rows.append(rowPermalink)
}
let sectionSettings = Section(header: VectorL10n.roomInfoListSectionOther,
rows: rows,
@@ -296,6 +308,8 @@ final class RoomInfoListViewController: UIViewController {
self.renderLoaded(viewData: viewData)
case .error(let error):
self.render(error: error)
case .permalinkCreated:
self.renderToast()
}
}
@@ -313,6 +327,10 @@ final class RoomInfoListViewController: UIViewController {
self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: nil)
}
private func renderToast() {
self.view.vc_toast(message: VectorL10n.roomEventCopyLinkInfo, image: UIImage(named: "link_icon"), duration: 2.0, position: .bottom, additionalMargin: 0)
}
private func doNotLeaveUIAlertController() -> UIAlertController {
let title = VectorL10n.roomParticipantsLeavePromptTitle
let message = NSLocalizedString("room_participants_cant_leave_prompt_message", tableName: "Vector", comment: "")