Merge branch 'iceshrimp' into 'main'

Support Iceshrimp

See merge request soapbox-pub/soapbox!2847
This commit is contained in:
marcin mikołajczak 2023-10-29 10:34:17 +00:00
commit 1cfeebdab4

View file

@ -14,24 +14,30 @@ const overrides = custom('features');
/** Truthy array convenience function */
const any = (arr: Array<any>): boolean => arr.some(Boolean);
/**
* Firefish, a fork of Misskey. Formerly known as Calckey.
* @see {@link https://joinfirefish.org/}
*/
export const FIREFISH = 'Firefish';
/**
* Ditto, a Nostr server with Mastodon API.
* @see {@link https://gitlab.com/soapbox-pub/ditto}
*/
export const DITTO = 'Ditto';
/**
* Firefish, a fork of Misskey. Formerly known as Calckey.
* @see {@link https://joinfirefish.org/}
*/
export const FIREFISH = 'Firefish';
/**
* Friendica, decentralized social platform implementing multiple federation protocols.
* @see {@link https://friendi.ca/}
*/
export const FRIENDICA = 'Friendica';
/**
* Iceshrimp, yet another Misskey fork.
* @see {@link https://iceshrimp.dev/}
*/
export const ICESHRIMP = 'Iceshrimp';
/**
* Mastodon, the software upon which this is all based.
* @see {@link https://joinmastodon.org/}
@ -143,6 +149,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
accountLookup: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.compatVersion, '3.4.0'),
v.software === PLEROMA && gte(v.version, '2.4.50'),
v.software === TAKAHE && gte(v.version, '0.6.1'),
@ -192,6 +199,7 @@ const getInstanceFeatures = (instance: Instance) => {
* @see {@link https://docs.joinmastodon.org/methods/announcements/}
*/
announcements: any([
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.compatVersion, '3.1.0'),
v.software === PLEROMA && gte(v.version, '2.2.49'),
v.software === TAKAHE && gte(v.version, '0.7.0'),
@ -230,6 +238,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
bookmarks: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === FRIENDICA,
v.software === MASTODON && gte(v.compatVersion, '3.1.0'),
v.software === PLEROMA && gte(v.version, '0.9.9'),
@ -319,6 +328,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
conversations: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === FRIENDICA,
v.software === MASTODON && gte(v.compatVersion, '2.6.0'),
v.software === PLEROMA && gte(v.version, '0.9.9'),
@ -359,6 +369,7 @@ const getInstanceFeatures = (instance: Instance) => {
editProfile: any([
v.software === FIREFISH,
v.software === FRIENDICA,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === MITRA,
v.software === PIXELFED,
@ -374,6 +385,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
editStatuses: any([
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.version, '3.5.0'),
v.software === TAKAHE && gte(v.version, '0.8.0'),
features.includes('editing'),
@ -444,6 +456,7 @@ const getInstanceFeatures = (instance: Instance) => {
exposableReactions: any([
v.software === FIREFISH,
v.software === FRIENDICA,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === TAKAHE && gte(v.version, '0.6.1'),
v.software === TRUTHSOCIAL,
@ -628,6 +641,7 @@ const getInstanceFeatures = (instance: Instance) => {
lists: any([
v.software === FIREFISH,
v.software === FRIENDICA,
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.compatVersion, '2.1.0'),
v.software === PLEROMA && gte(v.version, '0.9.9'),
]),
@ -683,6 +697,7 @@ const getInstanceFeatures = (instance: Instance) => {
* @see PUT /api/v1/accounts/:id/mute
*/
mutesDuration: any([
v.software === ICESHRIMP,
v.software === PLEROMA && gte(v.version, '2.3.0'),
v.software === MASTODON && gte(v.compatVersion, '3.3.0'),
v.software === TAKAHE,
@ -715,6 +730,7 @@ const getInstanceFeatures = (instance: Instance) => {
* @see GET /api/v1/notifications
*/
notificationsIncludeTypes: any([
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.compatVersion, '3.5.0'),
v.software === PLEROMA && gte(v.version, '2.4.50'),
v.software === TAKAHE && gte(v.version, '0.6.2'),
@ -739,6 +755,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
polls: any([
v.software === FIREFISH,
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.version, '2.8.0'),
v.software === PLEROMA,
v.software === TAKAHE && gte(v.version, '0.8.0'),
@ -779,6 +796,7 @@ const getInstanceFeatures = (instance: Instance) => {
publicTimeline: any([
v.software === FIREFISH,
v.software === FRIENDICA,
v.software === ICESHRIMP,
v.software === MASTODON,
v.software === PLEROMA,
v.software === TAKAHE,
@ -864,6 +882,7 @@ const getInstanceFeatures = (instance: Instance) => {
* @see POST /api/v2/search
*/
searchFromAccount: any([
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.version, '2.8.0'),
v.software === PLEROMA && gte(v.version, '1.0.0'),
]),
@ -917,6 +936,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
suggestionsV2: any([
v.software === FRIENDICA,
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.compatVersion, '3.4.0'),
v.software === TRUTHSOCIAL,
features.includes('v2_suggestions'),
@ -933,6 +953,7 @@ const getInstanceFeatures = (instance: Instance) => {
* @see GET /api/v1/trends/statuses
*/
trendingStatuses: any([
v.software === ICESHRIMP,
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
v.software === MASTODON && gte(v.compatVersion, '3.5.0'),
]),
@ -943,6 +964,7 @@ const getInstanceFeatures = (instance: Instance) => {
*/
trends: any([
v.software === FRIENDICA && gte(v.version, '2022.12.0'),
v.software === ICESHRIMP,
v.software === MASTODON && gte(v.compatVersion, '3.0.0'),
v.software === TRUTHSOCIAL,
v.software === DITTO,