From 70d73b690a8dc35419a965012a2d15187ab9f385 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 9 Oct 2024 13:31:34 +0300 Subject: [PATCH] broadcast: remove old option to disable sending to self The bug in WhatsApp android has probably been fixed by now --- broadcast.go | 7 +------ client.go | 9 ++------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/broadcast.go b/broadcast.go index d3bbf8e6..74df6966 100644 --- a/broadcast.go +++ b/broadcast.go @@ -37,12 +37,7 @@ func (cli *Client) getBroadcastListParticipants(jid types.JID) ([]types.JID, err break } } - if selfIndex >= 0 { - if cli.DontSendSelfBroadcast { - list[selfIndex] = list[len(list)-1] - list = list[:len(list)-1] - } - } else if !cli.DontSendSelfBroadcast { + if selfIndex < 0 { list = append(list, ownID) } return list, nil diff --git a/client.go b/client.go index 72bcf469..867021b3 100644 --- a/client.go +++ b/client.go @@ -147,10 +147,6 @@ type Client struct { // If false, decrypting a message from untrusted devices will fail. AutoTrustIdentity bool - // Should sending to own devices be skipped when sending broadcasts? - // This works around a bug in the WhatsApp android app where it crashes if you send a status message from a linked device. - DontSendSelfBroadcast bool - // Should SubscribePresence return an error if no privacy token is stored for the user? ErrorOnSubscribePresenceWithoutToken bool @@ -234,9 +230,8 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client { pendingPhoneRerequests: make(map[types.MessageID]context.CancelFunc), - EnableAutoReconnect: true, - AutoTrustIdentity: true, - DontSendSelfBroadcast: true, + EnableAutoReconnect: true, + AutoTrustIdentity: true, } cli.nodeHandlers = map[string]nodeHandler{ "message": cli.handleEncryptedMessage,