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;
|
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)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue