mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 12:46:58 +02:00
MESSENGER-4078 permalinks only in open rooms, better texts and icons
This commit is contained in:
@@ -211,7 +211,7 @@ final class RoomInfoListViewController: UIViewController {
|
||||
self.viewModel.process(viewAction: .navigate(target: .search))
|
||||
}
|
||||
|
||||
let rowPermalink = Row(type: .default, icon: nil, text: BWIL10n.roomDetailsPermalink, accessoryType: .none) {
|
||||
let rowPermalink = Row(type: .default, icon: Asset.Images.permalink.image, text: BWIL10n.roomDetailsPermalink, accessoryType: .none) {
|
||||
self.viewModel.process(viewAction: .permalink)
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ final class RoomInfoListViewController: UIViewController {
|
||||
rows.append(rowSearch)
|
||||
}
|
||||
|
||||
if BWIBuildSettings.shared.bwiAllowRoomPermalink {
|
||||
if BWIBuildSettings.shared.bwiAllowRoomPermalink && viewModel.isPermalinkableRoom() {
|
||||
rows.append(rowPermalink)
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,14 @@ final class RoomInfoListViewModel: NSObject, RoomInfoListViewModelType {
|
||||
func isPersonalNotesRoom() -> Bool {
|
||||
return room.isPersonalNotesRoom()
|
||||
}
|
||||
|
||||
func isInviteOnlyRoom() -> Bool {
|
||||
return room.summary.membership == .invite
|
||||
}
|
||||
|
||||
func isPermalinkableRoom() -> Bool {
|
||||
return !(isDirectRoom() || isPersonalNotesRoom() || isInviteOnlyRoom())
|
||||
}
|
||||
|
||||
func isOnlyMember() -> Bool {
|
||||
var memberCount = 0
|
||||
|
||||
@@ -39,4 +39,6 @@ protocol RoomInfoListViewModelType {
|
||||
func canLeaveRoom() -> Bool
|
||||
func isDirectRoom() -> Bool
|
||||
func isPersonalNotesRoom() -> Bool
|
||||
func isInviteOnlyRoom() -> Bool
|
||||
func isPermalinkableRoom() -> Bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user