From e245bcd751023f44e19340cb8aeb538e3272049f Mon Sep 17 00:00:00 2001 From: Alessandro Autiero Date: Wed, 25 Oct 2023 20:03:59 +0200 Subject: [PATCH] Fixed automaticPresenceUpdates first start bug --- src/main/java/it/auties/whatsapp/socket/StreamHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/it/auties/whatsapp/socket/StreamHandler.java b/src/main/java/it/auties/whatsapp/socket/StreamHandler.java index 876a9878..a0c1e6f6 100644 --- a/src/main/java/it/auties/whatsapp/socket/StreamHandler.java +++ b/src/main/java/it/auties/whatsapp/socket/StreamHandler.java @@ -1071,6 +1071,9 @@ private CompletableFuture queryInitialBlockList() { private CompletableFuture updateSelfPresence() { if (!socketHandler.store().automaticPresenceUpdates()) { + if(!socketHandler.store().online()) { // Just to be sure + socketHandler.sendWithNoResponse(Node.of("presence", Map.of("name", socketHandler.store().name(), "type", "unavailable"))); + } return CompletableFuture.completedFuture(null); }