diff options
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/retry.go')
-rw-r--r-- | vendor/go.mau.fi/whatsmeow/retry.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/retry.go b/vendor/go.mau.fi/whatsmeow/retry.go index 5cc460f9..a5a56d8f 100644 --- a/vendor/go.mau.fi/whatsmeow/retry.go +++ b/vendor/go.mau.fi/whatsmeow/retry.go @@ -148,6 +148,13 @@ func (cli *Client) handleRetryReceipt(receipt *events.Receipt, node *waBinary.No } else if bundle == nil { return fmt.Errorf("didn't get prekey bundle for %s (response size: %d)", senderAD, len(keys)) } + if retryCount > 3 { + cli.Log.Debugf("Erasing existing session for %s due to retry receipt with count>3", receipt.Sender) + err = cli.Store.Sessions.DeleteSession(receipt.Sender.SignalAddress().String()) + if err != nil { + return fmt.Errorf("failed to delete session for %s: %w", senderAD, err) + } + } } encrypted, includeDeviceIdentity, err := cli.encryptMessageForDevice(plaintext, receipt.Sender, bundle) if err != nil { @@ -161,6 +168,9 @@ func (cli *Client) handleRetryReceipt(receipt *events.Receipt, node *waBinary.No "id": messageID, "t": timestamp.Unix(), } + if !receipt.IsGroup { + attrs["device_fanout"] = false + } if participant, ok := node.Attrs["participant"]; ok { attrs["participant"] = participant } |