normalizeAccount(): normalize Pleroma legacy fields

This commit is contained in:
Alex Gleason
2022-02-27 20:21:39 -06:00
parent 2eefdbe235
commit 19ac4a54c2
8 changed files with 108 additions and 33 deletions

View File

@ -1,6 +1,7 @@
import { Map as ImmutableMap } from 'immutable';
import { parseVersion, PLEROMA } from 'soapbox/utils/features';
import { mergeDefined } from 'soapbox/utils/normalizers';
import { isNumber } from 'soapbox/utils/numbers';
// Use Mastodon defaults
@ -36,9 +37,6 @@ const pleromaToMastodonConfig = instance => {
});
};
// Use new value only if old value is undefined
const mergeDefined = (oldVal, newVal) => oldVal === undefined ? newVal : oldVal;
// Get the software's default attachment limit
const getAttachmentLimit = software => software === PLEROMA ? Infinity : 4;