diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index d9d0968c5b..664f725385 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -414,12 +414,8 @@ QtObject { return result } - function isStatusDeepLink(link) { - return link.includes(Constants.deepLinkPrefix) || link.includes(Constants.joinStatusLink) - } - function getLinkDataForStatusLinks(link) { - if (!isStatusDeepLink(link)) { + if (!Utils.isStatusDeepLink(link)) { return } diff --git a/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml b/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml index 4da8478630..feab1886ac 100644 --- a/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml +++ b/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml @@ -56,6 +56,9 @@ StatusModal { return } + if (Utils.isStatusDeepLink(text)) { + text = Utils.getChatKeyFromShareLink(text) + } Qt.callLater(d.lookupContact, text); } } diff --git a/ui/imports/utils/Utils.qml b/ui/imports/utils/Utils.qml index 61309a800d..61f826e571 100644 --- a/ui/imports/utils/Utils.qml +++ b/ui/imports/utils/Utils.qml @@ -451,6 +451,10 @@ QtObject { return matches[0].substring(3) } + function isStatusDeepLink(link) { + return link.includes(Constants.deepLinkPrefix) || link.includes(Constants.joinStatusLink) + } + function hasImageExtension(url) { return Constants.acceptedImageExtensions.some(ext => url.toLowerCase().includes(ext)) } @@ -604,6 +608,14 @@ QtObject { return colorForColorId(pubKeyColorId) } + function getChatKeyFromShareLink(link) { + let index = link.lastIndexOf("/u/") + if (index === -1) { + return link + } + return link.substring(index + 3) + } + function getCompressedPk(publicKey) { if (publicKey === "") { return ""