fix(backend): リモートのノートのメンション数制限が実際に解決できたユーザー数になっている問題を修正 (#17576)

* fix(backend): リモートのノートのメンション数制限が実際に解決できたユーザー数になっている問題を修正

* Update Changelog
This commit is contained in:
かっこかり
2026-06-18 20:35:16 +09:00
committed by GitHub
parent 3693adbb2d
commit 420d1f0f95
3 changed files with 6 additions and 1 deletions
@@ -182,6 +182,7 @@ type Option = {
visibleUsers?: MinimumUser[] | null;
channel?: MiChannel | null;
apMentions?: MinimumUser[] | null;
apMentionRawCount?: number | null;
apHashtags?: string[] | null;
apEmojis?: string[] | null;
uri?: string | null;
@@ -604,7 +605,8 @@ export class NoteCreateService implements OnApplicationShutdown {
}
}
if (mentionedUsers.length > 0 && mentionedUsers.length > (await this.roleService.getUserPolicies(user.id)).mentionLimit) {
const effectiveMentionCount = Math.max(mentionedUsers.length, data.apMentionRawCount ?? 0);
if (effectiveMentionCount > 0 && effectiveMentionCount > (await this.roleService.getUserPolicies(user.id)).mentionLimit) {
throw new IdentifiableError('9f466dab-c856-48cd-9e65-ff90ff750580', 'Note contains too many mentions');
}