From 01799b8cf71994d6216f5cd969a3e55b8a25c154 Mon Sep 17 00:00:00 2001 From: Andy Zhang <37402126+AnzhiZhang@users.noreply.github.com> Date: Thu, 22 Dec 2022 14:40:40 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=94=87=20remove=20kook=20websocket?= =?UTF-8?q?=20debug=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhanganzhi/chathub/receiver/KookReceiver.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java b/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java index 9a750d2..cec9403 100644 --- a/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java +++ b/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java @@ -73,7 +73,6 @@ private void sleep(long millis) { private void handleMessage(String text) { JSONObject signaling = JSON.parseObject(text); - logger.info("Kook websocket message received: " + signaling.toJSONString(JSONWriter.Feature.PrettyFormat)); // 信令 int type = signaling.getInteger("s"); if (type == 0) { @@ -83,13 +82,13 @@ private void handleMessage(String text) { // read data JSONObject eventData = signaling.getJSONObject("d"); - // ignore bot message - if (eventData.getJSONObject("extra").getJSONObject("author").getBoolean("bot")) { - return; - } - // Type 9: KMarkdown if (eventData.getInteger("type") == 9) { + // ignore bot message + if (eventData.getJSONObject("extra").getJSONObject("author").getBoolean("bot")) { + return; + } + // check channel if (eventData.getString("channel_type").equals("GROUP") && eventData.getString("target_id").equals(Config.getInstance().getKookChannelId())) { if (eventData.getString("content").equals("/list")) { @@ -108,7 +107,6 @@ private void handleMessage(String text) { () -> { websocket.send("{\"s\":2,\"sn\":" + sn + "}"); pingFinished = false; - logger.info("Kook websocket ping sent, sn=" + sn); // check pong in 6 seconds sleep(6000);