diff options
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/send.go')
-rw-r--r-- | vendor/go.mau.fi/whatsmeow/send.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/send.go b/vendor/go.mau.fi/whatsmeow/send.go index a3eae666..3216156e 100644 --- a/vendor/go.mau.fi/whatsmeow/send.go +++ b/vendor/go.mau.fi/whatsmeow/send.go @@ -17,6 +17,7 @@ import ( "strings" "time" + "go.mau.fi/libsignal/signalerror" "google.golang.org/protobuf/proto" "go.mau.fi/libsignal/groups" @@ -346,6 +347,11 @@ func (cli *Client) encryptMessageForDevice(plaintext []byte, to types.JID, bundl if bundle != nil { cli.Log.Debugf("Processing prekey bundle for %s", to) err := builder.ProcessBundle(bundle) + if cli.AutoTrustIdentity && errors.Is(err, signalerror.ErrUntrustedIdentity) { + cli.Log.Warnf("Got %v error while trying to process prekey bundle for %s, clearing stored identity and retrying", err, to) + cli.clearUntrustedIdentity(to) + err = builder.ProcessBundle(bundle) + } if err != nil { return nil, false, fmt.Errorf("failed to process prekey bundle: %w", err) } |