Skip to content

Commit

Permalink
Merge pull request #473 from Darker935/patch-1
Browse files Browse the repository at this point in the history
Fix editMessage() method
  • Loading branch information
Auties00 authored Apr 14, 2024
2 parents 00f8b3f + efa2a39 commit 053fec4
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.of(protocol))
.timestampSeconds(Clock.nowSeconds())
.broadcast(oldChatInfo.chatJid().hasServer(JidServer.BROADCAST))
.build();
Expand Down

0 comments on commit 053fec4

Please sign in to comment.