修复新人进房欢迎消息显示

This commit is contained in:
pllx
2026-04-27 14:05:11 +08:00
parent 8db1a252d7
commit 3d8e270df4
4 changed files with 56 additions and 15 deletions
+3 -2
View File
@@ -220,8 +220,9 @@ class ChatStateService
foreach ($messages as $msgJson) {
$msg = json_decode($msgJson, true);
// 只要消息里带了 welcome_user 且等于当前用户,就抛弃这条旧的
if ($msg && isset($msg['welcome_user']) && $msg['welcome_user'] === $username) {
// 只清理普通进出播报,避免误删新人礼包公告和 AI 小班长新人欢迎。
$welcomeKind = $msg['welcome_kind'] ?? 'entry_broadcast';
if ($msg && isset($msg['welcome_user']) && $msg['welcome_user'] === $username && $welcomeKind === 'entry_broadcast') {
continue;
}
$filtered[] = $msgJson;