parent
8458ce726c
commit
57d44889f2
@ -0,0 +1,16 @@
|
||||
const getDomain = account => {
|
||||
let re = /https?:\/\/(.*?)\//i;
|
||||
return re.exec(account.get('url'))[1];
|
||||
}
|
||||
|
||||
// user@domain even for local users
|
||||
export const acctFull = account => {
|
||||
let [user, domain] = account.get('acct').split('@');
|
||||
try {
|
||||
if (!domain) domain = getDomain(account);
|
||||
} catch(e) {
|
||||
console.error('Could not get domain for acctFull.');
|
||||
return account.get('acct');
|
||||
}
|
||||
return [user, domain].join('@');
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue