Skip to content

Commit

Permalink
broadcast: remove old option to disable sending to self
Browse files Browse the repository at this point in the history
The bug in WhatsApp android has probably been fixed by now
  • Loading branch information
tulir committed Oct 9, 2024
1 parent 6ba2d6c commit 70d73b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
7 changes: 1 addition & 6 deletions broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 70d73b6

Please sign in to comment.