Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions send.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ type SendRequestExtra struct {
MediaHandle string

Meta *types.MsgMetaInfo

// When sending status message you can specify the recipients
Participants []types.JID
}

// SendMessage sends the given message.
Expand Down Expand Up @@ -304,11 +307,15 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
extraParams.addressingMode = types.AddressingModePN
}
} else {
// TODO use context
groupParticipants, err = cli.getBroadcastListParticipants(to)
if err != nil {
err = fmt.Errorf("failed to get broadcast list members: %w", err)
return
if len(req.Participants) != 0 {
groupParticipants = req.Participants
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's better to validate/eliminate the participants that violate user privacy settings like blacklist
see getBroadcastListParticipants for reference

} else {
// TODO use context
groupParticipants, err = cli.getBroadcastListParticipants(to)
if err != nil {
err = fmt.Errorf("failed to get broadcast list members: %w", err)
return
}
}
}
resp.DebugTimings.GetParticipants = time.Since(start)
Expand Down