allow clicking lxmf urls in nomadnet pages to open conversation

This commit is contained in:
liamcottle
2024-05-29 04:01:52 +12:00
parent 5ace093e04
commit 1958f1d9ba

View File

@@ -985,6 +985,11 @@
return;
}
this.openLXMFConversation(destinationHash);
},
openLXMFConversation(destinationHash) {
// attempt to find existing peer so we can show their name
const existingPeer = this.peers[destinationHash];
if(existingPeer){
@@ -1359,6 +1364,15 @@
return;
}
// lxmf urls should open the conversation
if(url.startsWith("lxmf@")){
const destinationHash = url.replace("lxmf@", "");
if(destinationHash.length === 32){
this.openLXMFConversation(destinationHash);
return;
}
}
// attempt to parse url
const parsedUrl = this.parseNomadnetworkUrl(url);
if(parsedUrl != null){