forked from mirror/misskey
![Sayamame-beans](/assets/img/avatar_default.png)
* 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>
25 lines
557 B
TypeScript
25 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;
|
|
}
|