simplify uri
This commit is contained in:
parent
ee5c656e22
commit
1ad5d0b726
@ -1598,8 +1598,17 @@ bool parseRustdeskUri(String uriPath) {
|
|||||||
bool callUniLinksUriHandler(Uri uri) {
|
bool callUniLinksUriHandler(Uri uri) {
|
||||||
debugPrint("uni links called: $uri");
|
debugPrint("uni links called: $uri");
|
||||||
// new connection
|
// new connection
|
||||||
|
String peerId;
|
||||||
if (uri.authority == "connection" && uri.path.startsWith("/new/")) {
|
if (uri.authority == "connection" && uri.path.startsWith("/new/")) {
|
||||||
final peerId = uri.path.substring("/new/".length);
|
peerId = uri.path.substring("/new/".length);
|
||||||
|
} else if (uri.authority == "connect") {
|
||||||
|
peerId = uri.path.substring(1);
|
||||||
|
} else if (uri.authority.length > 2 && uri.path.length <= 1) {
|
||||||
|
// "/" or ""
|
||||||
|
peerId = uri.authority;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
var param = uri.queryParameters;
|
var param = uri.queryParameters;
|
||||||
String? switch_uuid = param["switch_uuid"];
|
String? switch_uuid = param["switch_uuid"];
|
||||||
String? password = param["password"];
|
String? password = param["password"];
|
||||||
@ -1608,8 +1617,6 @@ bool callUniLinksUriHandler(Uri uri) {
|
|||||||
password: password, switch_uuid: switch_uuid);
|
password: password, switch_uuid: switch_uuid);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
connectMainDesktop(String id,
|
connectMainDesktop(String id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user