summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/retry.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-05-09 23:00:23 +0200
committerGitHub <noreply@github.com>2022-05-09 23:00:23 +0200
commit1e55dd47f251ae588fb418ac29cbc6a0ae741e69 (patch)
treeb3b930c3f864d82ebeb079fcfbbf570b1620ca3f /vendor/go.mau.fi/whatsmeow/retry.go
parent700b95546b4fbc4bbd094ab1804406c13634d7e2 (diff)
downloadmatterbridge-msglm-1e55dd47f251ae588fb418ac29cbc6a0ae741e69.tar.gz
matterbridge-msglm-1e55dd47f251ae588fb418ac29cbc6a0ae741e69.tar.bz2
matterbridge-msglm-1e55dd47f251ae588fb418ac29cbc6a0ae741e69.zip
Update dependencies (#1831)
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/retry.go')
-rw-r--r--vendor/go.mau.fi/whatsmeow/retry.go10
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
}