Fix account relationships
This commit is contained in:
@ -136,8 +136,12 @@ const transformAccount = <T extends TransformableAccount>({ pleroma, other_setti
|
||||
moderator: pleroma?.is_moderator || false,
|
||||
location: account.location || pleroma?.location || other_settings?.location || '',
|
||||
note_emojified: emojify(account.note, customEmojiMap),
|
||||
pleroma,
|
||||
relationship: relationshipSchema.parse({ id: account.id, ...pleroma?.relationship }),
|
||||
pleroma: (() => {
|
||||
if (!pleroma) return undefined;
|
||||
const { relationship, ...rest } = pleroma;
|
||||
return rest;
|
||||
})(),
|
||||
relationship: pleroma?.relationship,
|
||||
staff: pleroma?.is_admin || pleroma?.is_moderator || false,
|
||||
suspended: account.suspended || pleroma?.deactivated || false,
|
||||
verified: account.verified || pleroma?.tags.includes('verified') || false,
|
||||
|
||||
@ -43,19 +43,8 @@ export const makeGetAccount = () => {
|
||||
getAccountPatron,
|
||||
], (base, counters, relationship, moved, meta, admin, patron) => {
|
||||
if (!base) return null;
|
||||
|
||||
base.relationship = base.relationship ?? relationship;
|
||||
return base;
|
||||
// return base.withMutations(map => {
|
||||
// if (counters) map.merge(counters);
|
||||
// if (meta) {
|
||||
// map.merge(meta);
|
||||
// map.set('pleroma', meta.pleroma.merge(base.get('pleroma') || ImmutableMap())); // Lol, thanks Pleroma
|
||||
// }
|
||||
// if (relationship) map.set('relationship', relationship);
|
||||
// map.set('moved', moved || null);
|
||||
// map.set('patron', patron || null);
|
||||
// map.setIn(['pleroma', 'admin'], admin);
|
||||
// });
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user