Skip to content

Commit 157848f

Browse files
committed
status: Add req.Participants for Status message
With req.Participants we can send status message to many (>50K) contacts in chunks, using the same message.id
1 parent 0866041 commit 157848f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

send.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ type SendRequestExtra struct {
147147
MediaHandle string
148148

149149
Meta *types.MsgMetaInfo
150+
151+
// When sending status message you can specify the recipients
152+
Participants []types.JID
150153
}
151154

152155
// SendMessage sends the given message.
@@ -304,11 +307,15 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
304307
extraParams.addressingMode = types.AddressingModePN
305308
}
306309
} else {
307-
// TODO use context
308-
groupParticipants, err = cli.getBroadcastListParticipants(to)
309-
if err != nil {
310-
err = fmt.Errorf("failed to get broadcast list members: %w", err)
311-
return
310+
if len(req.Participants) != 0 {
311+
groupParticipants = req.Participants
312+
} else {
313+
// TODO use context
314+
groupParticipants, err = cli.getBroadcastListParticipants(to)
315+
if err != nil {
316+
err = fmt.Errorf("failed to get broadcast list members: %w", err)
317+
return
318+
}
312319
}
313320
}
314321
resp.DebugTimings.GetParticipants = time.Since(start)

0 commit comments

Comments
 (0)