Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 05edbfa

Browse files
committed
修复: Websocket接收到消息事件会处理两次;
1 parent 4f6336a commit 05edbfa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mirai_bot.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,9 @@ namespace Cyan
867867

868868
while (true)
869869
{
870-
string event_json_str;
871870
if (ws_events->getReadyState() != WebSocket::CLOSED && this->ws_enabled_)
872871
{
872+
string event_json_str;
873873
ws_events->poll(20);
874874
ws_events->dispatch([&](const std::string& message)
875875
{
@@ -880,6 +880,7 @@ namespace Cyan
880880

881881
if (ws_command->getReadyState() != WebSocket::CLOSED)
882882
{
883+
string event_json_str;
883884
ws_command->poll(20);
884885
ws_command->dispatch([&](const std::string& message)
885886
{

0 commit comments

Comments
 (0)