From 33bb07afc4c5eb227e918ecd44c4806e34e62142 Mon Sep 17 00:00:00 2001 From: Quishot WADEV <70950705+Darker935@users.noreply.github.com> Date: Sat, 6 Apr 2024 05:11:09 -0300 Subject: [PATCH 1/2] Fix editMessage() method Setting additional protocolMessage to editedMessage --- src/main/java/it/auties/whatsapp/api/Whatsapp.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/auties/whatsapp/api/Whatsapp.java b/src/main/java/it/auties/whatsapp/api/Whatsapp.java index 16becb88..6d3d0533 100644 --- a/src/main/java/it/auties/whatsapp/api/Whatsapp.java +++ b/src/main/java/it/auties/whatsapp/api/Whatsapp.java @@ -656,11 +656,16 @@ public CompletableFuture editMessage(T oldMessage, Me .fromMe(true) .senderJid(jidOrThrowError()) .build(); + var protocol = new ProtocolMessageBuilder() + .protocolType(ProtocolMessage.Type.MESSAGE_EDIT) + .key(key) + .editedMessage(MessageContainer.of(newMessage)) + .build(); var info = new ChatMessageInfoBuilder() .status(MessageStatus.PENDING) .senderJid(jidOrThrowError()) .key(key) - .message(MessageContainer.ofEditedMessage(newMessage)) + .message(MessageContainer.ofEditedMessage(protocol)) .timestampSeconds(Clock.nowSeconds()) .broadcast(oldChatInfo.chatJid().hasServer(JidServer.BROADCAST)) .build(); From efa2a398089e753e70222a6697fe5c4330c4c533 Mon Sep 17 00:00:00 2001 From: Quishot WADEV <70950705+Darker935@users.noreply.github.com> Date: Sun, 7 Apr 2024 09:59:24 -0300 Subject: [PATCH 2/2] Update Whatsapp.java --- src/main/java/it/auties/whatsapp/api/Whatsapp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/auties/whatsapp/api/Whatsapp.java b/src/main/java/it/auties/whatsapp/api/Whatsapp.java index 6d3d0533..ef7599f0 100644 --- a/src/main/java/it/auties/whatsapp/api/Whatsapp.java +++ b/src/main/java/it/auties/whatsapp/api/Whatsapp.java @@ -665,7 +665,7 @@ public CompletableFuture editMessage(T oldMessage, Me .status(MessageStatus.PENDING) .senderJid(jidOrThrowError()) .key(key) - .message(MessageContainer.ofEditedMessage(protocol)) + .message(MessageContainer.of(protocol)) .timestampSeconds(Clock.nowSeconds()) .broadcast(oldChatInfo.chatJid().hasServer(JidServer.BROADCAST)) .build();