From 4842d9954f703f6d1fd8ea5815da1f224200103d Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 23 Mar 2023 22:35:09 +0100 Subject: [PATCH] Implement Hometown support --- src/constants.ts | 1 + src/pages/api/detect/[domain].ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 23f4b98..b868b08 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -8,6 +8,7 @@ export enum FediverseProject { Akkoma = "akkoma", Friendica = "friendica", GNUSocial = "gnusocial", + Hometown = "hometown", Hubzilla = "hubzilla", Mastodon = "mastodon", Misskey = "misskey", diff --git a/src/pages/api/detect/[domain].ts b/src/pages/api/detect/[domain].ts index eecd726..2dc7624 100644 --- a/src/pages/api/detect/[domain].ts +++ b/src/pages/api/detect/[domain].ts @@ -14,6 +14,13 @@ interface FediverseProjectData { }; } +const mastodonSettings = { + publishEndpoint: "share", + params: { + text: "text", + }, +}; + const pleromaSettings = { publishEndpoint: "share", params: { @@ -23,15 +30,8 @@ const pleromaSettings = { const PROJECTS: Map = new Map([ [FediverseProject.Akkoma, pleromaSettings], - [ - FediverseProject.Mastodon, - { - publishEndpoint: "share", - params: { - text: "text", - }, - }, - ], + [FediverseProject.Mastodon, mastodonSettings], + [FediverseProject.Hometown, mastodonSettings], [ FediverseProject.GNUSocial, {