From 5923b13fc13f06136956f9fecf2c40882ae6dff1 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 13 Feb 2021 17:24:39 +0100 Subject: [PATCH 1/2] Add FluffyChat --- images/client-icons/fluffychat.svg | 43 +++++++++++++++ src/open/clients/Fluffychat.js | 84 ++++++++++++++++++++++++++++++ src/open/clients/index.js | 10 ++-- 3 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 images/client-icons/fluffychat.svg create mode 100644 src/open/clients/Fluffychat.js diff --git a/images/client-icons/fluffychat.svg b/images/client-icons/fluffychat.svg new file mode 100644 index 0000000..a3a9516 --- /dev/null +++ b/images/client-icons/fluffychat.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/open/clients/Fluffychat.js b/src/open/clients/Fluffychat.js new file mode 100644 index 0000000..01796ac --- /dev/null +++ b/src/open/clients/Fluffychat.js @@ -0,0 +1,84 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import { Maturity, Platform, LinkKind, FlathubLink, AppleStoreLink, PlayStoreLink, WebsiteLink } from "../types.js"; + +/** + * Information on how to deep link to a given matrix client. + */ +export class Fluffychat { + get id() { return "im.fluffychat"; } + get name() { return "FluffyChat"; } + get icon() { return "images/client-icons/fluffychat.svg"; } + get author() { return "Krille Fear"; } + get homepage() { return "https://fluffychat.im"; } + get platforms() { + return [ + Platform.Android, Platform.iOS, + Platform.Windows, Platform.macOS, Platform.Linux, + Platform.DesktopWeb, + ]; + } + get description() { return "Chat with your friends using the cutest messenger in the Matrix network"; } + getMaturity(platform) { + switch (platform) { + case Platform.Android: return Maturity.Stable; + case Platform.iOS: return Maturity.Stable; + case Platform.DesktopWeb: return Maturity.Stable; + case Platform.Linux: return Maturity.Stable; + case Platform.macOS: return Maturity.Beta; + case Platform.Windows: return Maturity.Beta; + } + } + + getInstallLinks(platform) { + switch (platform) { + case Platform.iOS: return [new AppleStoreLink("fluffychat", "id1551469600")]; + case Platform.Android: return [new PlayStoreLink("chat.fluffy.fluffychat")]; + case Platform.Linux: return [new FlathubLink("im.fluffychat.Fluffychat")]; + default: return [new WebsiteLink("https://fluffychat.im")]; + } + } + + getLinkInstructions(platform, link) { + if (link.kind === LinkKind.User) { + switch (platform) { + case Platform.Android: return; + case Platform.DesktopWeb: return "Open the web app at https://fluffychat.im/web/ and log in to your account. Click on '+' and paste the username."; + default: return "Open the app and click on '+' and paste the username."; + } + } + if (link.kind === LinkKind.Room) { + switch (platform) { + case Platform.Android: return; + case Platform.DesktopWeb: return "Open the web app at https://fluffychat.im/web/ and log in to your account. Click on 'Discover' and paste the identifier."; + default: return "Open the app on your device. Click on 'Discover' and paste the identifier."; + } + } + } + + getCopyString(platform, link) { + if (link.kind === LinkKind.User || link.kind === LinkKind.Room) { + return link.identifier; + } + } + + getDeepLink(platform, link) { } + canInterceptMatrixToLinks(platform) { + return platform === Platform.Android; + } + + getPreferredWebInstance(link) { + return "fluffychat.im/web"; + } +} \ No newline at end of file diff --git a/src/open/clients/index.js b/src/open/clients/index.js index 9e4d7f8..8dc7c25 100644 --- a/src/open/clients/index.js +++ b/src/open/clients/index.js @@ -20,14 +20,16 @@ import {Nheko} from "./Nheko.js"; import {Fractal} from "./Fractal.js"; import {Quaternion} from "./Quaternion.js"; import {Tensor} from "./Tensor.js"; +import {Fluffychat} from "./Fluffychat.js"; export function createClients() { return [ new Element(), new Weechat(), - new Nheko(), - new Fractal(), - new Quaternion(), - new Tensor(), + new Nheko(), + new Fractal(), + new Quaternion(), + new Tensor(), + new Fluffychat(), ]; } From a02bc8aa2caa6773814f5359bbae706ae01bf72c Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 9 Apr 2021 20:49:44 +0200 Subject: [PATCH 2/2] Update Fluffychat.js --- src/open/clients/Fluffychat.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/open/clients/Fluffychat.js b/src/open/clients/Fluffychat.js index 01796ac..9955c6a 100644 --- a/src/open/clients/Fluffychat.js +++ b/src/open/clients/Fluffychat.js @@ -78,7 +78,5 @@ export class Fluffychat { return platform === Platform.Android; } - getPreferredWebInstance(link) { - return "fluffychat.im/web"; - } -} \ No newline at end of file + getPreferredWebInstance(link) {} +}