Refactor account FQN with Pleroma BE field

This commit is contained in:
Alex Gleason 2021-04-10 13:10:44 -05:00
parent d33c68a8a5
commit 4b5d22f172
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -16,13 +16,17 @@ export const getDomain = account => {
return domain; return domain;
}; };
// user@domain even for local users export const guessFqn = account => {
export const acctFull = account => {
const [user, domain] = account.get('acct').split('@'); const [user, domain] = account.get('acct').split('@');
if (!domain) return [user, guessDomain(account)].join('@'); if (!domain) return [user, guessDomain(account)].join('@');
return account.get('acct'); return account.get('acct');
}; };
// user@domain even for local users
export const acctFull = account => {
return account.get('fqn') || guessFqn(account);
};
export const isStaff = (account = ImmutableMap()) => ( export const isStaff = (account = ImmutableMap()) => (
[isAdmin, isModerator].some(f => f(account) === true) [isAdmin, isModerator].some(f => f(account) === true)
); );