mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Refactor handleIntentUri to work also with authorities
This commit is contained in:
parent
c83ce86252
commit
f6cd3b42ad
@ -239,7 +239,7 @@ ApplicationWindow
|
|||||||
|
|
||||||
function handleIntentUri(uriStr)
|
function handleIntentUri(uriStr)
|
||||||
{
|
{
|
||||||
console.log("handleIntentUri(uriStr)")
|
console.log("handleIntentUri(uriStr)", uriStr)
|
||||||
|
|
||||||
if(!Array.isArray(uriStr.match(/:\/\/[a-zA-Z.-]*\//g)))
|
if(!Array.isArray(uriStr.match(/:\/\/[a-zA-Z.-]*\//g)))
|
||||||
{
|
{
|
||||||
@ -257,7 +257,10 @@ ApplicationWindow
|
|||||||
|
|
||||||
var uri = new UriJs.URI(uriStr)
|
var uri = new UriJs.URI(uriStr)
|
||||||
var hPath = uri.path() // no nesting ATM segmentCoded()
|
var hPath = uri.path() // no nesting ATM segmentCoded()
|
||||||
console.log(hPath)
|
console.log("hPath", hPath)
|
||||||
|
|
||||||
|
var authority = uri.authority()
|
||||||
|
console.log("authority", authority)
|
||||||
|
|
||||||
if(typeof uriHandlersRegister[hPath] == "function")
|
if(typeof uriHandlersRegister[hPath] == "function")
|
||||||
{
|
{
|
||||||
@ -265,6 +268,13 @@ ApplicationWindow
|
|||||||
hPath, uriHandlersRegister[hPath])
|
hPath, uriHandlersRegister[hPath])
|
||||||
uriHandlersRegister[hPath](uriStr)
|
uriHandlersRegister[hPath](uriStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (typeof uriHandlersRegister[authority] == "function" )
|
||||||
|
{
|
||||||
|
console.log("handleIntentUri(uriStr)", "found handler for path",
|
||||||
|
authority, uriHandlersRegister[authority])
|
||||||
|
uriHandlersRegister[authority](uriStr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function certificateLinkHandler(uriStr)
|
function certificateLinkHandler(uriStr)
|
||||||
|
Loading…
Reference in New Issue
Block a user