From 157848f71d92b6de55c2fe10924f40dc4e2e1f66 Mon Sep 17 00:00:00 2001 From: devlikepro Date: Wed, 30 Apr 2025 10:38:17 +0700 Subject: [PATCH] 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 --- send.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/send.go b/send.go index 721a9d3ca..6f475edd4 100644 --- a/send.go +++ b/send.go @@ -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. @@ -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 + } 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)