mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
fix(backend): リモートのノートのメンション数制限が実際に解決できたユーザー数になっている問題を修正 (#17576)
* fix(backend): リモートのノートのメンション数制限が実際に解決できたユーザー数になっている問題を修正 * Update Changelog
This commit is contained in:
parent
3693adbb2d
commit
420d1f0f95
3 changed files with 6 additions and 1 deletions
|
|
@ -31,6 +31,7 @@
|
|||
- Fix: センシティブメディア自動検出周りの依存関係・ファイルの解決に失敗する問題を修正
|
||||
- Fix: フォロワー限定投稿を指名投稿で引用した際に、引用した投稿の公開範囲が意図せず変更される問題を修正
|
||||
- Fix: Startup and shutdown failures (port-in-use, socket permission denied, plugin timeouts, leaked WebSocket connections) are now reported through the misskey logger instead of an UnhandledPromiseRejectionWarning stack trace
|
||||
- Fix: リモートのノートに対するメンション数制限が、サーバーが解決できたユーザー数ベースで行われていた問題を修正
|
||||
|
||||
## 2026.5.4
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ export class ApNoteService {
|
|||
throw new IdentifiableError('85ab9bd7-3a41-4530-959d-f07073900109', 'actor has been suspended');
|
||||
}
|
||||
|
||||
const apMentionRawCount = new Set(this.apMentionService.extractApMentionObjects(note.tag).map(x => x.href)).size;
|
||||
const apMentions = await this.apMentionService.extractApMentions(note.tag, resolver);
|
||||
const apHashtags = extractApHashtags(note.tag);
|
||||
|
||||
|
|
@ -324,6 +325,7 @@ export class ApNoteService {
|
|||
visibility,
|
||||
visibleUsers,
|
||||
apMentions,
|
||||
apMentionRawCount,
|
||||
apHashtags,
|
||||
apEmojis,
|
||||
poll,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue