2023-07-27 14:31:52 +09:00
|
|
|
/*
|
2024-02-14 00:59:27 +09:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 14:31:52 +09:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-10-04 16:43:24 +09:00
|
|
|
export function isUserRelated(note: any, userIds: Set<string>, ignoreAuthor = false): boolean {
|
|
|
|
if (userIds.has(note.userId) && !ignoreAuthor) {
|
2022-06-27 21:48:10 +09:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-10-04 16:48:34 +09:00
|
|
|
if (note.reply != null && note.reply.userId !== note.userId && userIds.has(note.reply.userId)) {
|
2022-06-27 21:48:10 +09:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-10-04 16:48:34 +09:00
|
|
|
if (note.renote != null && note.renote.userId !== note.userId && userIds.has(note.renote.userId)) {
|
2022-06-27 21:48:10 +09:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|