Refactor account FQN with Pleroma BE field
This commit is contained in:
parent
d33c68a8a5
commit
4b5d22f172
1 changed files with 6 additions and 2 deletions
|
@ -16,13 +16,17 @@ export const getDomain = account => {
|
|||
return domain;
|
||||
};
|
||||
|
||||
// user@domain even for local users
|
||||
export const acctFull = account => {
|
||||
export const guessFqn = account => {
|
||||
const [user, domain] = account.get('acct').split('@');
|
||||
if (!domain) return [user, guessDomain(account)].join('@');
|
||||
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()) => (
|
||||
[isAdmin, isModerator].some(f => f(account) === true)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue