From f3b8fa86ee347a6d6d5ca06cc71ad560163518e2 Mon Sep 17 00:00:00 2001 From: Quishot WADEV <70950705+Darker935@users.noreply.github.com> Date: Sat, 15 Jun 2024 22:22:37 -0300 Subject: [PATCH] Responding a ping request from the server Server sometimes send a ping request to the client, and we need to sent `result` to this --- src/main/java/it/auties/whatsapp/socket/StreamHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/it/auties/whatsapp/socket/StreamHandler.java b/src/main/java/it/auties/whatsapp/socket/StreamHandler.java index ae846c12..10026658 100644 --- a/src/main/java/it/auties/whatsapp/socket/StreamHandler.java +++ b/src/main/java/it/auties/whatsapp/socket/StreamHandler.java @@ -1337,6 +1337,11 @@ private void onMediaConnection(Node node) { } private void digestIq(Node node) { + if (node.attributes().hasValue("xmlns", "urn:xmpp:ping")) { + socketHandler.sendQueryWithNoResponse("result", null); + return; + } + var container = node.findNode().orElse(null); if (container == null) { return;