This commit is contained in:
2025-06-26 10:25:54 +08:00
parent 5c04064df1
commit 4161e7b77d

View File

@@ -80,9 +80,9 @@ class GatewayClientService
/**
* 广播消息给所有用户(可排除指定用户)
*/
public function broadcastMessage(int $fromUserId, string $fromUserName, string $text, ?int $excludeUserId = null): void
public function broadcastMessage(int $fromUserId, string $fromUserName, string $text, ?int $excludeUserId = null, string $type = 'chat'): void
{
$message = $this->buildMessage($fromUserId, $fromUserName, $text);
$message = $this->buildMessage($fromUserId, $fromUserName, $text, $type);
$excludeList = $excludeUserId ? [$excludeUserId] : [];
Gateway::sendToAll($message, null, $excludeList);