Skip to content

Commit

Permalink
Fix editing newsletter messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 18, 2023
1 parent 7581a42 commit 9ac5986
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions send.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,12 @@ func (cli *Client) sendNewsletter(to types.JID, id types.MessageID, message *waP
"type": getTypeFromMessage(message),
}
if message.EditedMessage != nil {
message = message.GetEditedMessage().GetMessage().GetProtocolMessage().GetEditedMessage()
attrs["id"] = types.MessageID(message.GetEditedMessage().GetMessage().GetProtocolMessage().GetKey().GetId())
attrs["edit"] = EditAttributeAdminEdit
message = message.GetEditedMessage().GetMessage().GetProtocolMessage().GetEditedMessage()
} else if message.ProtocolMessage != nil && message.ProtocolMessage.GetType() == waProto.ProtocolMessage_REVOKE {
attrs["edit"] = EditAttributeAdminRevoke
attrs["id"] = types.MessageID(message.ProtocolMessage.GetKey().GetId())
attrs["id"] = types.MessageID(message.GetProtocolMessage().GetKey().GetId())
message = nil
}
start := time.Now()
Expand Down

0 comments on commit 9ac5986

Please sign in to comment.