mirror of
https://github.com/paricafe/misskey.git
synced 2025-01-08 19:20:50 -06:00
20 lines
459 B
TypeScript
20 lines
459 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
export function isUserRelated(note: any, userIds: Set<string>, ignoreAuthor = false): boolean {
|
|
if (userIds.has(note.userId) && !ignoreAuthor) {
|
|
return true;
|
|
}
|
|
|
|
if (note.reply != null && userIds.has(note.reply.userId)) {
|
|
return true;
|
|
}
|
|
|
|
if (note.renote != null && userIds.has(note.renote.userId)) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|