summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/send.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/send.go')
-rw-r--r--vendor/go.mau.fi/whatsmeow/send.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/send.go b/vendor/go.mau.fi/whatsmeow/send.go
index 3216156e..041f7fdf 100644
--- a/vendor/go.mau.fi/whatsmeow/send.go
+++ b/vendor/go.mau.fi/whatsmeow/send.go
@@ -35,13 +35,13 @@ import (
// msgID := whatsmeow.GenerateMessageID()
// cli.SendMessage(targetJID, msgID, &waProto.Message{...})
func GenerateMessageID() types.MessageID {
- id := make([]byte, 16)
+ id := make([]byte, 8)
_, err := rand.Read(id)
if err != nil {
// Out of entropy
panic(err)
}
- return strings.ToUpper(hex.EncodeToString(id))
+ return "3EB0" + strings.ToUpper(hex.EncodeToString(id))
}
// SendMessage sends the given message.
@@ -229,7 +229,11 @@ func (cli *Client) prepareMessageNode(to types.JID, id types.MessageID, message
}},
}
if message.ProtocolMessage != nil && message.GetProtocolMessage().GetType() == waProto.ProtocolMessage_REVOKE && message.GetProtocolMessage().GetKey() != nil {
- node.Attrs["edit"] = "7"
+ if message.GetProtocolMessage().GetKey().GetFromMe() {
+ node.Attrs["edit"] = "7"
+ } else {
+ node.Attrs["edit"] = "8"
+ }
}
if includeIdentity {
err := cli.appendDeviceIdentityNode(&node)