mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-01-07 17:52:16 +01:00
4b9c60ad21
* fix: mute/block was not considered on users/reactions * docs(changelog): update changelog * chore: Apply suggestion from code review Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> --------- Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
24 lines
557 B
TypeScript
24 lines
557 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
export function isUserRelated(note: any, userIds: Set<string>, ignoreAuthor = false): boolean {
|
|
if (!note) {
|
|
return false;
|
|
}
|
|
|
|
if (userIds.has(note.userId) && !ignoreAuthor) {
|
|
return true;
|
|
}
|
|
|
|
if (note.reply != null && note.reply.userId !== note.userId && userIds.has(note.reply.userId)) {
|
|
return true;
|
|
}
|
|
|
|
if (note.renote != null && note.renote.userId !== note.userId && userIds.has(note.renote.userId)) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|