From 1832b39b7bfa0b0b2c20e148a69560a56dddf759 Mon Sep 17 00:00:00 2001 From: Slayer95 Date: Tue, 17 Mar 2026 00:03:01 -0500 Subject: [PATCH] Allow highlighting on broadcast !faq,rfaq,daily,avatars (#11818) --- server/chat-commands/avatars.tsx | 7 +++---- server/chat-commands/info.ts | 2 +- server/chat-plugins/daily-spotlight.ts | 2 +- server/chat-plugins/room-faqs.ts | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/server/chat-commands/avatars.tsx b/server/chat-commands/avatars.tsx index 48a4e0db80..abc604f42a 100644 --- a/server/chat-commands/avatars.tsx +++ b/server/chat-commands/avatars.tsx @@ -772,12 +772,11 @@ export const commands: Chat.ChatCommands = { const targetUser = this.broadcasting && !target ? null : this.getUserOrSelf(target); const targetUserids = targetUser ? new Set([targetUser.id, ...targetUser.previousIDs]) : target ? new Set([toID(target)]) : null; - if (targetUserids && targetUser !== user && !user.can('alts')) { - throw new Chat.ErrorMessage("You don't have permission to look at another user's avatars!"); - } const out = []; - if (targetUserids) { + if (targetUserids && (targetUser === user || user.can('alts'))) { + // If the user lacks permission to view avatars, the argument is ignored silently, + // so that it can highlight the target user. const hasButton = !this.broadcasting && targetUser === user; for (const id of targetUserids) { const allowed = customAvatars[id]?.allowed; diff --git a/server/chat-commands/info.ts b/server/chat-commands/info.ts index ca1eb36bf0..926174b18c 100644 --- a/server/chat-commands/info.ts +++ b/server/chat-commands/info.ts @@ -2128,7 +2128,7 @@ export const commands: Chat.ChatCommands = { ], faq(target, room, user) { - target = toID(target); + target = toID(this.splitOne(target)[0]); const showAll = target === 'all'; if (showAll && this.shouldBroadcast()) { throw new Chat.ErrorMessage(this.tr`You cannot broadcast all FAQs at once.`); diff --git a/server/chat-plugins/daily-spotlight.ts b/server/chat-plugins/daily-spotlight.ts index 4dad14fc0b..c8bb39ec37 100644 --- a/server/chat-plugins/daily-spotlight.ts +++ b/server/chat-plugins/daily-spotlight.ts @@ -279,7 +279,7 @@ export const commands: Chat.ChatCommands = { daily(target, room, user) { room = this.requireRoom(); if (!room.persist) throw new Chat.ErrorMessage("This command is unavailable in temporary rooms."); - const key = toID(target); + const key = toID(this.splitOne(target)[0]); if (!key) return this.parse('/help daily'); if (!spotlights[room.roomid]?.[key]) { diff --git a/server/chat-plugins/room-faqs.ts b/server/chat-plugins/room-faqs.ts index d1b462e2a6..7400f406f7 100644 --- a/server/chat-plugins/room-faqs.ts +++ b/server/chat-plugins/room-faqs.ts @@ -161,7 +161,7 @@ export const commands: Chat.ChatCommands = { roomfaq(target, room, user, connection, cmd) { room = this.requireRoom(); if (!roomFaqs[room.roomid]) throw new Chat.ErrorMessage("This room has no FAQ topics."); - let topic: string = toID(target); + let topic: string = toID(this.splitOne(target)[0]); if (topic === 'constructor') return false; if (!topic) { return this.parse(`/join view-roomfaqs-${room.roomid}`);