From b14120a6365779693b707a4d868286e25cf9ebe9 Mon Sep 17 00:00:00 2001 From: gzydong Date: Mon, 30 Nov 2020 22:59:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Amqp/Consumer/ChatMessageConsumer.php | 10 +++++----- composer.json | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) 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",