Split local-visibility-post feature into @pleroma and @akkoma variants

Co-authored-by: Lim Chee Aun <cheeaun@gmail.com>
This commit is contained in:
Stefano Pigozzi 2024-09-07 03:14:50 +02:00
parent 1aff56a6bd
commit 33d6edda38
No known key found for this signature in database
GPG key ID: 5ADA3868646C3FC0
2 changed files with 5 additions and 3 deletions

View file

@ -1169,7 +1169,7 @@ function Compose({
<option value="public"> <option value="public">
<Trans>Public</Trans> <Trans>Public</Trans>
</option> </option>
{supports('@pleroma/local-visibility-post') && {(supports('@pleroma/local-visibility-post') || supports('@akkoma/local-visibility-post')) &&
<option value="local"> <option value="local">
<Trans>Local</Trans> <Trans>Local</Trans>
</option> </option>

View file

@ -7,7 +7,8 @@ import { getCurrentInstance } from './store-utils';
// Non-semver(?) UA string detection // Non-semver(?) UA string detection
const containPixelfed = /pixelfed/i; const containPixelfed = /pixelfed/i;
const notContainPixelfed = /^(?!.*pixelfed).*$/i; const notContainPixelfed = /^(?!.*pixelfed).*$/i;
const containAnyOma = /(?:pler|akk)oma/i const containPleroma = /pleroma/i;
const containAkkoma = /akkoma/i;
const platformFeatures = { const platformFeatures = {
'@mastodon/lists': notContainPixelfed, '@mastodon/lists': notContainPixelfed,
'@mastodon/filters': notContainPixelfed, '@mastodon/filters': notContainPixelfed,
@ -21,7 +22,8 @@ const platformFeatures = {
'@pixelfed/trending': containPixelfed, '@pixelfed/trending': containPixelfed,
'@pixelfed/home-include-reblogs': containPixelfed, '@pixelfed/home-include-reblogs': containPixelfed,
'@pixelfed/global-feed': containPixelfed, '@pixelfed/global-feed': containPixelfed,
'@pleroma/local-visibility-post': containAnyOma, '@pleroma/local-visibility-post': containPleroma,
'@akkoma/local-visibility-post': containAkkoma,
}; };
const supportsCache = {}; const supportsCache = {};