Fixing rebase.
This commit is contained in:
parent
03022742d8
commit
a3368b091e
|
@ -15,11 +15,13 @@ type ChatController* = ref object
|
|||
status*: Status
|
||||
variant*: QVariant
|
||||
appService: AppService
|
||||
uriToOpen: string
|
||||
|
||||
proc newController*(status: Status, appService: AppService): ChatController =
|
||||
proc newController*(status: Status, appService: AppService, uriToOpen: string): ChatController =
|
||||
result = ChatController()
|
||||
result.status = status
|
||||
result.appService = appService
|
||||
result.uriToOpen = uriToOpen
|
||||
result.view = newChatsView(status, appService)
|
||||
result.variant = newQVariant(result.view)
|
||||
|
||||
|
@ -65,6 +67,9 @@ proc init*(self: ChatController) =
|
|||
self.status.events.on("network:connected") do(e: Args):
|
||||
self.view.stickers.clearStickerPacks()
|
||||
self.view.stickers.obtainAvailableStickerPacks()
|
||||
if self.uriToOpen != "":
|
||||
self.view.handleProtocolUri(self.uriToOpen)
|
||||
self.uriToOpen = ""
|
||||
|
||||
proc loadInitialMessagesForChannel*(self: ChatController, channelId: string) =
|
||||
if (channelId.len == 0):
|
||||
|
|
|
@ -562,4 +562,14 @@ QtObject:
|
|||
)
|
||||
|
||||
self.appService.osNotificationService.showNotification(title, message,
|
||||
details, useOSNotifications)
|
||||
details, useOSNotifications)
|
||||
|
||||
proc handleProtocolUri*(self: ChatsView, uri: string) =
|
||||
# for now this only supports links to 1-1 chats, e.g.
|
||||
# status-im://0x04ecb3636368be823f9c62e2871f8ea5b52eb3fac0132bdcf9e57907a9cb1024d81927fb3ce12fea6d9b9a8f1acb24370df756108170ab0e3454ae93aa601f3c33
|
||||
# TODO: support other chat types
|
||||
let pubKey = uri.replace("status-im://", "").replace("/", "")
|
||||
if pubKey.startsWith("0x"):
|
||||
self.status.chat.createOneToOneChat(pubKey)
|
||||
self.setActiveChannel(pubKey)
|
||||
|
Loading…
Reference in New Issue