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