summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/send.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-04-25 23:50:10 +0200
committerGitHub <noreply@github.com>2022-04-25 23:50:10 +0200
commit67adad3e08fe17d5f7e87468ea47aa76e1662255 (patch)
tree91314fac90d39254e66ae794decfcd21c10a7b20 /vendor/go.mau.fi/whatsmeow/send.go
parent2fca3c756373577eab4e0120ccce62eecc1f5ad8 (diff)
downloadmatterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.gz
matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.bz2
matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.zip
Update dependencies (#1813)
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)