mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
MESSENGER-4093 scan permalinks as qr
This commit is contained in:
committed by
Frank Rotermund
parent
1bff461abb
commit
eb618b395d
@@ -22,6 +22,7 @@ enum AllChatsEditActionProviderOption {
|
||||
case createRoom
|
||||
case startChat
|
||||
case createSpace
|
||||
case scanPermalink
|
||||
}
|
||||
|
||||
protocol AllChatsEditActionProviderDelegate: AnyObject {
|
||||
@@ -50,29 +51,57 @@ class AllChatsEditActionProvider {
|
||||
// MARK: - RoomActionProviderProtocol
|
||||
|
||||
var menu: UIMenu {
|
||||
guard parentSpace != nil else {
|
||||
var createActions = [
|
||||
self.createRoomAction,
|
||||
self.startChatAction
|
||||
]
|
||||
if rootSpaceCount > 0 && BWIBuildSettings.shared.enableSpaces {
|
||||
createActions.insert(self.createSpaceAction, at: 0)
|
||||
if BWIBuildSettings.shared.allowScanPermalinkQRCode {
|
||||
guard parentSpace != nil else {
|
||||
var createActions = [
|
||||
self.exploreRoomsAction,
|
||||
self.createRoomAction,
|
||||
self.startChatAction
|
||||
]
|
||||
if rootSpaceCount > 0 && BWIBuildSettings.shared.enableSpaces {
|
||||
createActions.insert(self.createSpaceAction, at: 0)
|
||||
}
|
||||
return UIMenu(title: "", children: [
|
||||
self.scanPermalinkAction,
|
||||
UIMenu(title: "", options: .displayInline, children: createActions)
|
||||
])
|
||||
}
|
||||
|
||||
return UIMenu(title: "", children: [
|
||||
self.exploreRoomsAction,
|
||||
UIMenu(title: "", options: .displayInline, children: createActions)
|
||||
UIMenu(title: "", options: .displayInline, children: [
|
||||
self.scanPermalinkAction
|
||||
]),
|
||||
UIMenu(title: "", options: .displayInline, children: [
|
||||
self.exploreRoomsAction,
|
||||
self.createSpaceAction,
|
||||
self.createRoomAction
|
||||
])
|
||||
])
|
||||
} else {
|
||||
guard parentSpace != nil else {
|
||||
var createActions = [
|
||||
self.createRoomAction,
|
||||
self.startChatAction
|
||||
]
|
||||
if rootSpaceCount > 0 && BWIBuildSettings.shared.enableSpaces {
|
||||
createActions.insert(self.createSpaceAction, at: 0)
|
||||
}
|
||||
return UIMenu(title: "", children: [
|
||||
self.exploreRoomsAction,
|
||||
UIMenu(title: "", options: .displayInline, children: createActions)
|
||||
])
|
||||
}
|
||||
|
||||
return UIMenu(title: "", children: [
|
||||
UIMenu(title: "", options: .displayInline, children: [
|
||||
self.exploreRoomsAction
|
||||
]),
|
||||
UIMenu(title: "", options: .displayInline, children: [
|
||||
self.createSpaceAction,
|
||||
self.createRoomAction
|
||||
])
|
||||
])
|
||||
}
|
||||
|
||||
return UIMenu(title: "", children: [
|
||||
UIMenu(title: "", options: .displayInline, children: [
|
||||
self.exploreRoomsAction
|
||||
]),
|
||||
UIMenu(title: "", options: .displayInline, children: [
|
||||
self.createSpaceAction,
|
||||
self.createRoomAction
|
||||
])
|
||||
])
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
@@ -167,4 +196,14 @@ class AllChatsEditActionProvider {
|
||||
self.delegate?.allChatsEditActionProvider(self, didSelect: .createSpace)
|
||||
}
|
||||
}
|
||||
|
||||
private var scanPermalinkAction: UIAction {
|
||||
UIAction(title: BWIL10n.roomRecentsScanQrCode,
|
||||
image: Asset.Images.qrcodeViewfinder.image) { [weak self] action in
|
||||
guard let self = self else { return }
|
||||
|
||||
self.delegate?.allChatsEditActionProvider(self, didSelect: .scanPermalink)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user