From 0528f5d9334e1210826e918b0c6acc0810a16fdf Mon Sep 17 00:00:00 2001 From: Andrei Smirnov Date: Thu, 9 Sep 2021 17:54:11 +0300 Subject: [PATCH] Fixed link structure for 1-1 chats --- src/app/chat/view.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index 27083f44b3..d833635d0d 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -566,10 +566,13 @@ QtObject: proc handleProtocolUri*(self: ChatsView, uri: string) = # for now this only supports links to 1-1 chats, e.g. - # status-im://0x04ecb3636368be823f9c62e2871f8ea5b52eb3fac0132bdcf9e57907a9cb1024d81927fb3ce12fea6d9b9a8f1acb24370df756108170ab0e3454ae93aa601f3c33 + # status-im://p/0x04ecb3636368be823f9c62e2871f8ea5b52eb3fac0132bdcf9e57907a9cb1024d81927fb3ce12fea6d9b9a8f1acb24370df756108170ab0e3454ae93aa601f3c33 # TODO: support other chat types - let pubKey = uri.replace("status-im://", "").replace("/", "") - if pubKey.startsWith("0x"): + let parts = uri.replace("status-im://", "").split("/") + if parts.len == 2 and parts[0] == "p" and parts[1].startsWith("0x"): + let pubKey = parts[1] self.status.chat.createOneToOneChat(pubKey) self.setActiveChannel(pubKey) + return + echo "Unsupported deep link structure: " & uri \ No newline at end of file