summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/broadcast.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-03-09 22:48:00 +0100
committerGitHub <noreply@github.com>2023-03-09 22:48:00 +0100
commit08779c29099e8940493df56d28d8aa131ac8342e (patch)
tree7ad8ce25cf371e582137e1706dd671a6bf4342d0 /vendor/go.mau.fi/whatsmeow/broadcast.go
parentd5f9cdf912d43cd2a5cb243e086fbdab9a9073b0 (diff)
downloadmatterbridge-msglm-08779c29099e8940493df56d28d8aa131ac8342e.tar.gz
matterbridge-msglm-08779c29099e8940493df56d28d8aa131ac8342e.tar.bz2
matterbridge-msglm-08779c29099e8940493df56d28d8aa131ac8342e.zip
Update dependencies (#2007)
* Update dependencies
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/broadcast.go')
-rw-r--r--vendor/go.mau.fi/whatsmeow/broadcast.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/broadcast.go b/vendor/go.mau.fi/whatsmeow/broadcast.go
index a61ccfb6..d3bbf8e6 100644
--- a/vendor/go.mau.fi/whatsmeow/broadcast.go
+++ b/vendor/go.mau.fi/whatsmeow/broadcast.go
@@ -30,14 +30,19 @@ func (cli *Client) getBroadcastListParticipants(jid types.JID) ([]types.JID, err
return nil, ErrNotLoggedIn
}
- var hasSelf bool
- for _, participant := range list {
+ selfIndex := -1
+ for i, participant := range list {
if participant.User == ownID.User {
- hasSelf = true
+ selfIndex = i
break
}
}
- if !hasSelf {
+ if selfIndex >= 0 {
+ if cli.DontSendSelfBroadcast {
+ list[selfIndex] = list[len(list)-1]
+ list = list[:len(list)-1]
+ }
+ } else if !cli.DontSendSelfBroadcast {
list = append(list, ownID)
}
return list, nil