Update dependencies (#1813)
This commit is contained in:
12
vendor/go.mau.fi/whatsmeow/client.go
vendored
12
vendor/go.mau.fi/whatsmeow/client.go
vendored
@@ -10,6 +10,7 @@ package whatsmeow
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -110,6 +111,8 @@ type Client struct {
|
||||
// If false, decrypting a message from untrusted devices will fail.
|
||||
AutoTrustIdentity bool
|
||||
|
||||
DebugDecodeBeforeSend bool
|
||||
|
||||
uniqueID string
|
||||
idCounter uint32
|
||||
|
||||
@@ -497,6 +500,15 @@ func (cli *Client) sendNode(node waBinary.Node) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to marshal node: %w", err)
|
||||
}
|
||||
if cli.DebugDecodeBeforeSend {
|
||||
var decoded *waBinary.Node
|
||||
decoded, err = waBinary.Unmarshal(payload[1:])
|
||||
if err != nil {
|
||||
cli.Log.Infof("Malformed payload: %s", base64.URLEncoding.EncodeToString(payload))
|
||||
return fmt.Errorf("failed to decode the binary we just produced: %w", err)
|
||||
}
|
||||
node = *decoded
|
||||
}
|
||||
|
||||
cli.sendLog.Debugf("%s", node.XMLString())
|
||||
return sock.SendFrame(payload)
|
||||
|
||||
Reference in New Issue
Block a user