From 578f5879413a662eaebe683759e347feeb84dda6 Mon Sep 17 00:00:00 2001 From: pllx Date: Wed, 29 Apr 2026 11:35:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E7=8C=9C=E6=88=90=E8=AF=AD?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=B1=8F=E8=94=BD=E9=80=9A=E7=9F=A5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/chat-room/chat-state.js | 2 +- resources/js/chat-room/preferences-status.js | 13 ++++++++++++- .../views/chat/partials/layout/input-bar.blade.php | 5 +++++ resources/views/chat/partials/scripts.blade.php | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/resources/js/chat-room/chat-state.js b/resources/js/chat-room/chat-state.js index 4e95f40..3a7fff8 100644 --- a/resources/js/chat-room/chat-state.js +++ b/resources/js/chat-room/chat-state.js @@ -1,7 +1,7 @@ // 聊天室共享运行时状态,桥接 Blade 闭包作用域与 Vite 模块。 // 所有需要跨模块共享的可变状态集中在此管理,通过 window.chatState 访问。 -export const BLOCKABLE_SYSTEM_SENDERS = ["钓鱼播报", "星海小博士", "百家乐", "跑马", "神秘箱子"]; +export const BLOCKABLE_SYSTEM_SENDERS = ["钓鱼播报", "猜成语", "星海小博士", "百家乐", "跑马", "神秘箱子"]; export const BLOCKED_SYSTEM_SENDERS_STORAGE_KEY = "chat_blocked_system_senders"; export const CHAT_SOUND_MUTED_STORAGE_KEY = "chat_sound_muted"; export const PUBLIC_MESSAGE_NODE_LIMIT = 600; diff --git a/resources/js/chat-room/preferences-status.js b/resources/js/chat-room/preferences-status.js index 9866c0c..06c3df0 100644 --- a/resources/js/chat-room/preferences-status.js +++ b/resources/js/chat-room/preferences-status.js @@ -1,6 +1,6 @@ // 聊天室偏好与每日状态工具,承接从 Blade 内联脚本迁移出的纯数据规整逻辑。 -export const BLOCKABLE_SYSTEM_SENDERS = ["钓鱼播报", "星海小博士", "百家乐", "跑马", "神秘箱子"]; +export const BLOCKABLE_SYSTEM_SENDERS = ["钓鱼播报", "猜成语", "星海小博士", "百家乐", "跑马", "神秘箱子"]; export const BLOCKED_SYSTEM_SENDERS_STORAGE_KEY = "chat_blocked_system_senders"; export const CHAT_SOUND_MUTED_STORAGE_KEY = "chat_sound_muted"; // 白名单、localStorage key 与绑定标记共同保证偏好读取可控、事件只注册一次。 @@ -476,6 +476,16 @@ export function shouldMigrateLocalChatPreferences(serverPreferences, localBlocke export function resolveBlockedSystemSenderKey(msg) { const fromUser = String(msg?.from_user || ""); const content = String(msg?.content || ""); + const action = String(msg?.action || ""); + const idiomRoundId = Number.parseInt( + String(msg?.idiom_game_round_id || msg?.idom_game_round_id || msg?.idiom_game_round_ended_id || "0"), + 10, + ); + + // 猜成语消息独立作为一个通知类型管理,不再复用“星海小博士”的屏蔽规则。 + if (idiomRoundId > 0 || action === "idiom_result" || (fromUser === "星海小博士" && content.includes("猜成语"))) { + return "猜成语"; + } if (fromUser === "钓鱼播报") { return "钓鱼播报"; @@ -581,6 +591,7 @@ export function syncBlockedSystemSenderCheckboxes() { const checkboxMap = { "block-sender-fishing": "钓鱼播报", + "block-sender-idiom": "猜成语", "block-sender-doctor": "星海小博士", "block-sender-baccarat": "百家乐", "block-sender-horse-race": "跑马", diff --git a/resources/views/chat/partials/layout/input-bar.blade.php b/resources/views/chat/partials/layout/input-bar.blade.php index 1adafef..06f699d 100644 --- a/resources/views/chat/partials/layout/input-bar.blade.php +++ b/resources/views/chat/partials/layout/input-bar.blade.php @@ -135,6 +135,11 @@ $welcomeMessages = [ 钓鱼播报 +