Allow highlighting on broadcast !faq,rfaq,daily,avatars (#11818)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run

This commit is contained in:
Slayer95 2026-03-17 00:03:01 -05:00 committed by GitHub
parent 84f6e93478
commit 1832b39b7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

View File

@ -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;

View File

@ -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.`);

View File

@ -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]) {

View File

@ -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}`);