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