Skip to content

Commit 70d73b6

Browse files
committed
broadcast: remove old option to disable sending to self
The bug in WhatsApp android has probably been fixed by now
1 parent 6ba2d6c commit 70d73b6

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

broadcast.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ func (cli *Client) getBroadcastListParticipants(jid types.JID) ([]types.JID, err
3737
break
3838
}
3939
}
40-
if selfIndex >= 0 {
41-
if cli.DontSendSelfBroadcast {
42-
list[selfIndex] = list[len(list)-1]
43-
list = list[:len(list)-1]
44-
}
45-
} else if !cli.DontSendSelfBroadcast {
40+
if selfIndex < 0 {
4641
list = append(list, ownID)
4742
}
4843
return list, nil

client.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ type Client struct {
147147
// If false, decrypting a message from untrusted devices will fail.
148148
AutoTrustIdentity bool
149149

150-
// Should sending to own devices be skipped when sending broadcasts?
151-
// This works around a bug in the WhatsApp android app where it crashes if you send a status message from a linked device.
152-
DontSendSelfBroadcast bool
153-
154150
// Should SubscribePresence return an error if no privacy token is stored for the user?
155151
ErrorOnSubscribePresenceWithoutToken bool
156152

@@ -234,9 +230,8 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client {
234230

235231
pendingPhoneRerequests: make(map[types.MessageID]context.CancelFunc),
236232

237-
EnableAutoReconnect: true,
238-
AutoTrustIdentity: true,
239-
DontSendSelfBroadcast: true,
233+
EnableAutoReconnect: true,
234+
AutoTrustIdentity: true,
240235
}
241236
cli.nodeHandlers = map[string]nodeHandler{
242237
"message": cli.handleEncryptedMessage,

0 commit comments

Comments
 (0)