Skip to content

Commit 22e6027

Browse files
authored
startchat: normalize identifiers to phone numbers when creating group (#855)
1 parent 25ea0d9 commit 22e6027

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/connector/startchat.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@ func (wa *WhatsAppClient) CreateGroup(ctx context.Context, params *bridgev2.Grou
217217
CreateKey: createKey,
218218
}
219219
for i, participant := range params.Participants {
220-
req.Participants[i] = waid.ParseUserID(participant)
220+
jid := waid.ParseUserID(participant)
221+
// Normalize to PN if it's a LID
222+
jid, err := wa.startChatLIDToPN(ctx, jid)
223+
if err != nil {
224+
return nil, fmt.Errorf("failed to normalize participant %s: %w", participant, err)
225+
}
226+
req.Participants[i] = jid
221227
}
222228
if params.Parent != nil {
223229
var err error

0 commit comments

Comments
 (0)