send: include privacy token when sending DMs

This commit is contained in:
Tulir Asokan committed 2025-06-05 16:12:10 +03:00
1 parent 73d070ff1c
commit 9cd01960b5
1 file changed
+10
+10
View File
@@ -799,6 +799,16 @@ func (cli *Client) sendDM(
if err != nil {
return nil, err
}
if tcToken, err := cli.Store.PrivacyTokens.GetPrivacyToken(ctx, to); err != nil {
cli.Log.Warnf("Failed to get privacy token for %s: %v", to, err)
} else if tcToken != nil {
node.Content = append(node.GetChildren(), waBinary.Node{
Tag: "tctoken",
Content: tcToken.Token,
})
}
start = time.Now()
data, err := cli.sendNodeAndGetData(*node)
timings.Send = time.Since(start)