From dbc054eda77b1ea4b32515a6b279da1ad07a9bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 4 Jan 2024 15:36:13 +0100 Subject: [PATCH 1/2] Add deeplink for Fractal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses the same code as Nheko. Signed-off-by: Kévin Commaille --- src/open/clients/Fractal.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/open/clients/Fractal.js b/src/open/clients/Fractal.js index 882d1d7..4e1328d 100644 --- a/src/open/clients/Fractal.js +++ b/src/open/clients/Fractal.js @@ -28,7 +28,35 @@ export class Fractal { get platforms() { return [Platform.Linux]; } get description() { return 'GNOME client, suitable for desktop and mobile. Written in Rust.'; } getMaturity(platform) { return Maturity.Beta; } - getDeepLink(platform, link) {} + + getDeepLink(platform, link) { + if (platform === Platform.Linux) { + let identifier = encodeURIComponent(link.identifier.substring(1)); + let isRoomid = link.identifier.substring(0, 1) === '!'; + let fragmentPath; + switch (link.kind) { + case LinkKind.User: + fragmentPath = `u/${identifier}?action=chat`; + break; + case LinkKind.Room: + case LinkKind.Event: + if (isRoomid) + fragmentPath = `roomid/${identifier}`; + else + fragmentPath = `r/${identifier}`; + + if (link.kind === LinkKind.Event) + fragmentPath += `/e/${encodeURIComponent(link.eventId.substring(1))}`; + fragmentPath += '?action=join'; + fragmentPath += link.servers.map(server => `&via=${encodeURIComponent(server)}`).join(''); + break; + case LinkKind.Group: + return; + } + return `matrix:${fragmentPath}`; + } + } + canInterceptMatrixToLinks(platform) { return false; } getLinkInstructions(platform, link) { From d3458399c577d6d85fcd9faa0671ccb5bf2f6d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 18 Jan 2024 19:35:42 +0100 Subject: [PATCH 2/2] Update Fractal homepage URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- src/open/clients/Fractal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/open/clients/Fractal.js b/src/open/clients/Fractal.js index 4e1328d..b2c0637 100644 --- a/src/open/clients/Fractal.js +++ b/src/open/clients/Fractal.js @@ -24,7 +24,7 @@ export class Fractal { get name() { return "Fractal"; } get icon() { return "images/client-icons/fractal.svg"; } get author() { return "Daniel Garcia Moreno"; } - get homepage() { return "https://gitlab.gnome.org/GNOME/fractal"; } + get homepage() { return "https://gitlab.gnome.org/World/fractal"; } get platforms() { return [Platform.Linux]; } get description() { return 'GNOME client, suitable for desktop and mobile. Written in Rust.'; } getMaturity(platform) { return Maturity.Beta; }