diff --git a/app/soapbox/utils/__tests__/features-test.js b/app/soapbox/utils/__tests__/features-test.js index 77f8d882a..900928fa0 100644 --- a/app/soapbox/utils/__tests__/features-test.js +++ b/app/soapbox/utils/__tests__/features-test.js @@ -92,4 +92,20 @@ describe('getFeatures', () => { expect(features.trends).toBe(false); }); }); + + describe('attachmentLimit', () => { + it('is 4 by default', () => { + const instance = ImmutableMap({ version: '3.1.4' }); + const features = getFeatures(instance); + expect(features.attachmentLimit).toEqual(4); + }); + + it('is Infinity for Pleroma', () => { + const instance = ImmutableMap({ + version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)', + }); + const features = getFeatures(instance); + expect(features.attachmentLimit).toEqual(Infinity); + }); + }); }); diff --git a/app/soapbox/utils/features.js b/app/soapbox/utils/features.js index 6ef0ba834..2c29b34dc 100644 --- a/app/soapbox/utils/features.js +++ b/app/soapbox/utils/features.js @@ -7,6 +7,7 @@ export const getFeatures = instance => { suggestions: v.software === 'Mastodon' && semver.gte(v.compatVersion, '2.4.3'), trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'), emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'), + attachmentLimit: v.software === 'Pleroma' ? Infinity : 4, }; };