Sharkey/packages/backend/src/misc/is-system-account.ts

17 lines
409 B
TypeScript
Raw Normal View History

/*
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
2024-10-07 11:45:58 -04:00
interface UserLike {
readonly username: string;
readonly host: string | null;
}
/**
* Checks if the given user represents a system account, such as instance.actor.
*/
2024-10-07 11:45:58 -04:00
export function isSystemAccount(user: UserLike): boolean {
return user.host == null && user.username.includes('.');
}