diff --git a/app/Amqp/Consumer/ChatMessageConsumer.php b/app/Amqp/Consumer/ChatMessageConsumer.php index c5bde1d..4257d7a 100644 --- a/app/Amqp/Consumer/ChatMessageConsumer.php +++ b/app/Amqp/Consumer/ChatMessageConsumer.php @@ -247,7 +247,7 @@ class ChatMessageConsumer extends ConsumerMessage unset($result, $file, $code_block, $forward, $invite); - $server = websocket(); + $server = server(); $notify = json_encode(['event_talk', $msg]); foreach ($fds as $fd) { $server->exist($fd) && $server->push($fd, $notify); @@ -266,7 +266,7 @@ class ChatMessageConsumer extends ConsumerMessage public function onConsumeKeyboard(array $data, AMQPMessage $message) { $fds = $this->socketClientService->findUserFds($data['data']['receive_user']); - $server = websocket(); + $server = server(); $notify = json_encode(['event_keyboard', $data['data']]); foreach ($fds as $fd) { $server->exist($fd) && $server->push($fd, $notify); @@ -293,7 +293,7 @@ class ChatMessageConsumer extends ConsumerMessage } $fds = array_unique($fds); - $server = websocket(); + $server = server(); $notify = json_encode(['event_online_status', $data['data']]); foreach ($fds as $fd) { $server->exist($fd) && $server->push($fd, $notify); @@ -326,7 +326,7 @@ class ChatMessageConsumer extends ConsumerMessage } $fds = array_unique($fds); - $server = websocket(); + $server = server(); $notify = json_encode(['event_revoke_talk', [ 'record_id' => $record->id, 'source' => $record->source, @@ -353,7 +353,7 @@ class ChatMessageConsumer extends ConsumerMessage $fds = $this->socketClientService->findUserFds($data['data']['receive']); $fds = array_unique($fds); - $server = websocket(); + $server = server(); $notify = json_encode(['event_friend_apply', $data['data']]); foreach ($fds as $fd) { $server->exist($fd) && $server->push($fd, $notify); diff --git a/composer.json b/composer.json index 9549594..901460e 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "phper666/jwt-auth": "^3.0", "hyperf/filesystem": "^2.0", "hyperf/socketio-server": "^2.0", - "hashids/hashids": "^4.0" + "hashids/hashids": "^4.0", + "ext-json": "^1.6" }, "require-dev": { "swoole/ide-helper": "^4.5",