Add preliminary Pixelfed support

merge-requests/1203/head
Alex Gleason 2022-04-10 18:21:52 -05:00
rodzic 2ea13e2582
commit 41d49e0fe7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
4 zmienionych plików z 84 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,66 @@
{
"uri": "pixelfed.social",
"title": "pixelfed",
"short_description": "Pixelfed is an image sharing platform, an ethical alternative to centralized platforms",
"description": "Pixelfed is an image sharing platform, an ethical alternative to centralized platforms",
"email": "hello@pixelfed.org",
"version": "2.7.2 (compatible; Pixelfed 0.11.2)",
"urls": {
"streaming_api": "wss://pixelfed.social"
},
"stats": {
"user_count": 45061,
"status_count": 301357,
"domain_count": 5028
},
"thumbnail": "https://pixelfed.social/img/pixelfed-icon-color.png",
"languages": [
"en"
],
"registrations": true,
"approval_required": false,
"contact_account": {
"id": "1",
"username": "admin",
"acct": "admin",
"display_name": "Admin",
"discoverable": true,
"locked": false,
"followers_count": 419,
"following_count": 2,
"statuses_count": 6,
"note": "pixelfed.social Admin. Managed by @dansup",
"url": "https://pixelfed.social/admin",
"avatar": "https://pixelfed.social/storage/avatars/000/000/000/001/LSHNCgwbby7wu3iCYV6H_avatar.png?v=4",
"created_at": "2018-06-01T03:54:08.000000Z",
"avatar_static": "https://pixelfed.social/storage/avatars/000/000/000/001/LSHNCgwbby7wu3iCYV6H_avatar.png?v=4",
"bot": false,
"emojis": [],
"fields": [],
"header": "https://pixelfed.social/storage/headers/missing.png",
"header_static": "https://pixelfed.social/storage/headers/missing.png",
"last_status_at": null
},
"rules": [
{
"id": "1",
"text": "Sexually explicit or violent media must be marked as sensitive when posting"
},
{
"id": "2",
"text": "No racism, sexism, homophobia, transphobia, xenophobia, or casteism"
},
{
"id": "3",
"text": "No incitement of violence or promotion of violent ideologies"
},
{
"id": "4",
"text": "No harassment, dogpiling or doxxing of other users"
},
{
"id": "5",
"text": "No content illegal in United States"
}
]
}

Wyświetl plik

@ -185,4 +185,10 @@ describe('normalizeInstance()', () => {
expect(result.version).toEqual('3.5.0-rc1');
});
it('normalizes Pixelfed instance', () => {
const instance = require('soapbox/__fixtures__/pixelfed-instance.json');
const result = normalizeInstance(instance);
expect(result.title).toBe('pixelfed');
});
});

Wyświetl plik

@ -23,6 +23,15 @@ describe('parseVersion', () => {
compatVersion: '3.0.0',
});
});
it('with a Pixelfed version string', () => {
const version = '2.7.2 (compatible; Pixelfed 0.11.2)';
expect(parseVersion(version)).toEqual({
software: 'Pixelfed',
version: '0.11.2',
compatVersion: '2.7.2',
});
});
});
describe('getFeatures', () => {

Wyświetl plik

@ -19,6 +19,7 @@ export const MASTODON = 'Mastodon';
export const PLEROMA = 'Pleroma';
export const MITRA = 'Mitra';
export const TRUTHSOCIAL = 'TruthSocial';
export const PIXELFED = 'Pixelfed';
const getInstanceFeatures = (instance: Instance) => {
const v = parseVersion(instance.version);
@ -41,6 +42,7 @@ const getInstanceFeatures = (instance: Instance) => {
bookmarks: any([
v.software === MASTODON && gte(v.compatVersion, '3.1.0'),
v.software === PLEROMA && gte(v.version, '0.9.9'),
v.software === PIXELFED,
]),
lists: any([
v.software === MASTODON && gte(v.compatVersion, '2.1.0'),
@ -73,6 +75,7 @@ const getInstanceFeatures = (instance: Instance) => {
conversations: any([
v.software === MASTODON && gte(v.compatVersion, '2.6.0'),
v.software === PLEROMA && gte(v.version, '0.9.9'),
v.software === PIXELFED,
]),
emojiReacts: v.software === PLEROMA && gte(v.version, '2.0.0'),
emojiReactsRGI: v.software === PLEROMA && gte(v.version, '2.2.49'),