fix(@desktop/chat): Accept profile deep link in "Send Contact Request to chat key"
Fix #8070
This commit is contained in:
parent
6a72773ab6
commit
234a164597
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,9 @@ StatusModal {
|
|||
return
|
||||
}
|
||||
|
||||
if (Utils.isStatusDeepLink(text)) {
|
||||
text = Utils.getChatKeyFromShareLink(text)
|
||||
}
|
||||
Qt.callLater(d.lookupContact, text);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 ""
|
||||
|
|
Loading…
Reference in New Issue