From acf4e634fe41055f0e2c65454969d2c0ae0cf0be Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 14 Jan 2025 23:32:02 +0800 Subject: [PATCH] :bug: Fix websocket will put message in wrong channel --- lib/controllers/chat_message_controller.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/controllers/chat_message_controller.dart b/lib/controllers/chat_message_controller.dart index 8949c81..a4c4d3b 100644 --- a/lib/controllers/chat_message_controller.dart +++ b/lib/controllers/chat_message_controller.dart @@ -74,6 +74,7 @@ class ChatMessageController extends ChangeNotifier { _wsSubscription = _ws.stream.stream.listen((event) { switch (event.method) { case 'events.new': + if (event.payload?['channel_id'] != channel?.id) break; final payload = SnChatMessage.fromJson(event.payload!); _addMessage(payload); break;