feat: 欢迎语增加右下角弹窗通知;禁止对「大家」发送欢迎

This commit is contained in:
pllx
2026-04-28 14:40:27 +08:00
parent 55fd770fdd
commit abb5512222
3 changed files with 18 additions and 3 deletions
+11
View File
@@ -449,6 +449,17 @@ class ChatController extends Controller
$messageData = array_merge($messageData, $imagePayload);
}
// 欢迎动作:增加右下角弹窗通知(内容含发送者信息)
if (($data['action'] ?? '') === '欢迎') {
$messageData['toast_notification'] = [
'title' => '👋 欢迎',
'message' => strip_tags($pureContent),
'icon' => '👋',
'color' => '#e11d48',
'duration' => 8000,
];
}
// 6.5 将用户当前激活的消息装扮注入广播 payload(气泡样式 + 昵称颜色),前端据此渲染消息外观
$decorations = app(\App\Services\DecorationService::class)->getDecorationsForMessage($user);
$messageData = array_merge($messageData, $decorations);