add cinny deep link
This commit is contained in:
parent
fac2f9bf29
commit
9750d5e245
1 changed files with 23 additions and 12 deletions
|
@ -48,24 +48,35 @@ export class Cinny {
|
||||||
return Maturity.Stable;
|
return Maturity.Stable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cinny doesn't support deep links yet
|
getDeepLink(platform, link) {
|
||||||
getDeepLink(platform, link) {}
|
let fragmentPath;
|
||||||
|
|
||||||
|
switch (link.kind) {
|
||||||
|
case LinkKind.User:
|
||||||
|
fragmentPath = `direct/${encodeURIComponent(link.identifier)}`;
|
||||||
|
break;
|
||||||
|
case LinkKind.Room:
|
||||||
|
fragmentPath = `home/${encodeURIComponent(link.identifier)}`;
|
||||||
|
break;
|
||||||
|
case LinkKind.Event:
|
||||||
|
fragmentPath = `home/${encodeURIComponent(link.identifier)}/${encodeURIComponent(link.eventId)}`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((link.kind === LinkKind.Event || link.kind === LinkKind.Room) && link.servers.length > 0) {
|
||||||
|
fragmentPath += `?via=${link.servers.map(server => encodeURIComponent(server)).join(',')}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `https://app.cinny.in/${fragmentPath}`
|
||||||
|
}
|
||||||
|
|
||||||
canInterceptMatrixToLinks(platform) {
|
canInterceptMatrixToLinks(platform) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getLinkInstructions(platform, link) {
|
getLinkInstructions(platform, link) {}
|
||||||
return [
|
|
||||||
"While in Home, Click on '+' in the top left corner, then 'Join with address' and paste the ",
|
|
||||||
style.code(`${link.identifier} `),
|
|
||||||
link.kind === LinkKind.User ? "username" : "identifier",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
getCopyString(platform, link) {
|
getCopyString(platform, link) {}
|
||||||
return link.identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
getInstallLinks(platform) {}
|
getInstallLinks(platform) {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue