From 9750d5e245d110b4ac7ba9dc6ae0854456305289 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sun, 28 Jul 2024 09:08:07 +0530 Subject: [PATCH 1/3] add cinny deep link --- src/open/clients/Cinny.js | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/open/clients/Cinny.js b/src/open/clients/Cinny.js index 6770275..260bb37 100644 --- a/src/open/clients/Cinny.js +++ b/src/open/clients/Cinny.js @@ -48,24 +48,35 @@ export class Cinny { 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) { return false; } - 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", - ]; - } + getLinkInstructions(platform, link) {} - getCopyString(platform, link) { - return link.identifier; - } + getCopyString(platform, link) {} getInstallLinks(platform) {} From 0123ab498826cf9d31ed3a6b8fa966694f66eed7 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:50:18 +0530 Subject: [PATCH 2/3] update user link path --- src/open/clients/Cinny.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/open/clients/Cinny.js b/src/open/clients/Cinny.js index 260bb37..defe256 100644 --- a/src/open/clients/Cinny.js +++ b/src/open/clients/Cinny.js @@ -53,7 +53,7 @@ export class Cinny { switch (link.kind) { case LinkKind.User: - fragmentPath = `direct/${encodeURIComponent(link.identifier)}`; + fragmentPath = `direct/create?userId${encodeURIComponent(link.identifier)}`; break; case LinkKind.Room: fragmentPath = `home/${encodeURIComponent(link.identifier)}`; From e97ac79e059abb644487fca7afa223b31bff9600 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:51:07 +0530 Subject: [PATCH 3/3] fix typo in user path --- src/open/clients/Cinny.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/open/clients/Cinny.js b/src/open/clients/Cinny.js index defe256..831ccc5 100644 --- a/src/open/clients/Cinny.js +++ b/src/open/clients/Cinny.js @@ -53,7 +53,7 @@ export class Cinny { switch (link.kind) { case LinkKind.User: - fragmentPath = `direct/create?userId${encodeURIComponent(link.identifier)}`; + fragmentPath = `direct/create?userId=${encodeURIComponent(link.identifier)}`; break; case LinkKind.Room: fragmentPath = `home/${encodeURIComponent(link.identifier)}`;