Skip to content

Commit

Permalink
Fix editMessage() method
Browse files Browse the repository at this point in the history
Setting additional protocolMessage to editedMessage
  • Loading branch information
Darker935 authored Apr 6, 2024
1 parent 00f8b3f commit 33bb07a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/it/auties/whatsapp/api/Whatsapp.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,16 @@ public <T extends MessageInfo> CompletableFuture<T> 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();
Expand Down

0 comments on commit 33bb07a

Please sign in to comment.