Merge branch 'pixelfed' into 'next'
Next: Add preliminary Pixelfed support See merge request soapbox-pub/soapbox-fe!1203
This commit is contained in:
commit
75fc0bf904
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -185,4 +185,10 @@ describe('normalizeInstance()', () => {
|
||||||
|
|
||||||
expect(result.version).toEqual('3.5.0-rc1');
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,6 +23,15 @@ describe('parseVersion', () => {
|
||||||
compatVersion: '3.0.0',
|
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', () => {
|
describe('getFeatures', () => {
|
||||||
|
|
|
@ -19,6 +19,7 @@ export const MASTODON = 'Mastodon';
|
||||||
export const PLEROMA = 'Pleroma';
|
export const PLEROMA = 'Pleroma';
|
||||||
export const MITRA = 'Mitra';
|
export const MITRA = 'Mitra';
|
||||||
export const TRUTHSOCIAL = 'TruthSocial';
|
export const TRUTHSOCIAL = 'TruthSocial';
|
||||||
|
export const PIXELFED = 'Pixelfed';
|
||||||
|
|
||||||
const getInstanceFeatures = (instance: Instance) => {
|
const getInstanceFeatures = (instance: Instance) => {
|
||||||
const v = parseVersion(instance.version);
|
const v = parseVersion(instance.version);
|
||||||
|
@ -41,6 +42,7 @@ const getInstanceFeatures = (instance: Instance) => {
|
||||||
bookmarks: any([
|
bookmarks: any([
|
||||||
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'),
|
||||||
|
v.software === PIXELFED,
|
||||||
]),
|
]),
|
||||||
lists: any([
|
lists: any([
|
||||||
v.software === MASTODON && gte(v.compatVersion, '2.1.0'),
|
v.software === MASTODON && gte(v.compatVersion, '2.1.0'),
|
||||||
|
@ -73,6 +75,7 @@ const getInstanceFeatures = (instance: Instance) => {
|
||||||
conversations: any([
|
conversations: any([
|
||||||
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'),
|
||||||
|
v.software === PIXELFED,
|
||||||
]),
|
]),
|
||||||
emojiReacts: v.software === PLEROMA && gte(v.version, '2.0.0'),
|
emojiReacts: v.software === PLEROMA && gte(v.version, '2.0.0'),
|
||||||
emojiReactsRGI: v.software === PLEROMA && gte(v.version, '2.2.49'),
|
emojiReactsRGI: v.software === PLEROMA && gte(v.version, '2.2.49'),
|
||||||
|
|
Loading…
Reference in New Issue