diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index 9ecaf9e3c2..ea905e9ffc 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -563,7 +563,7 @@ QtObject: self.appService.osNotificationService.showNotification(title, message, details, useOSNotifications) - proc handleProtocolUri*(self: ChatsView, uri: string) = + proc handleProtocolUri*(self: ChatsView, uri: string) {.slot.} = # for now this only supports links to 1-1 chats, e.g. # status-im://p/0x04ecb3636368be823f9c62e2871f8ea5b52eb3fac0132bdcf9e57907a9cb1024d81927fb3ce12fea6d9b9a8f1acb24370df756108170ab0e3454ae93aa601f3c33 # TODO: support other chat types diff --git a/src/nim_status_client.nim b/src/nim_status_client.nim index c5c847d00d..3873f5c6bb 100644 --- a/src/nim_status_client.nim +++ b/src/nim_status_client.nim @@ -1,4 +1,4 @@ -import NimQml, chronicles, os, strformat, times, md5 +import NimQml, chronicles, os, strformat, times, md5, json import app/chat/core as chat import app/wallet/v1/core as wallet @@ -66,7 +66,10 @@ proc mainProc() = "/../resources.rcc" QResource.registerResource(app.applicationDirPath & resources) - let singleInstance = newSingleInstance($toMD5(DATADIR)) + var eventStr = "" + if OPENURI.len > 0: + eventStr = $(%* { "uri": OPENURI }) + let singleInstance = newSingleInstance($toMD5(DATADIR), eventStr) defer: singleInstance.delete() if singleInstance.secondInstance(): info "Terminating the app as the second instance" diff --git a/ui/main.qml b/ui/main.qml index d906a4f4a0..0c13b27b9d 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -131,6 +131,15 @@ StatusWindow { applicationWindow.raise() applicationWindow.requestActivate() } + + onEventReceived: { + let event = JSON.parse(eventStr) + if (event.hasOwnProperty("uri")) { + chatsModel.handleProtocolUri(event.uri) + } else { + console.warn("Unknown event received: " + eventStr) + } + } } // The easiest way to get current system theme (is it light or dark) without using diff --git a/vendor/DOtherSide b/vendor/DOtherSide index 966fb752dd..22d40f37fc 160000 --- a/vendor/DOtherSide +++ b/vendor/DOtherSide @@ -1 +1 @@ -Subproject commit 966fb752dd29876ac15fb31ab59fb017fba7a9b3 +Subproject commit 22d40f37fcfe202b28acfecece045106bab05742 diff --git a/vendor/nimqml b/vendor/nimqml index f2f8f3a9e9..42b3b1af5b 160000 --- a/vendor/nimqml +++ b/vendor/nimqml @@ -1 +1 @@ -Subproject commit f2f8f3a9e921e93b7f5d1961600919611b300066 +Subproject commit 42b3b1af5bdb254a82998566f147ddb1156a5141