check for host
This commit is contained in:
parent
adc7b91e3b
commit
39214431f4
2 changed files with 31 additions and 15 deletions
|
|
@ -3,9 +3,14 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
interface UserLike {
|
||||
readonly username: string;
|
||||
readonly host: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given user represents a system account, such as instance.actor.
|
||||
*/
|
||||
export function isSystemAccount(user: { readonly username: string }): boolean {
|
||||
return user.username.includes('.');
|
||||
export function isSystemAccount(user: UserLike): boolean {
|
||||
return user.host == null && user.username.includes('.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue