Skip to content

Commit 2a3b5c3

Browse files
committed
startchat: normalize LID to PN
1 parent d188d14 commit 2a3b5c3

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
@@ -213,7 +213,13 @@ func (wa *WhatsAppClient) CreateGroup(ctx context.Context, params *bridgev2.Grou
213213
CreateKey: createKey,
214214
}
215215
for i, participant := range params.Participants {
216-
req.Participants[i] = waid.ParseUserID(participant)
216+
jid := waid.ParseUserID(participant)
217+
// Normalize to PN if it's a LID
218+
jid, err := wa.startChatLIDToPN(ctx, jid)
219+
if err != nil {
220+
return nil, fmt.Errorf("failed to normalize participant %s: %w", participant, err)
221+
}
222+
req.Participants[i] = jid
217223
}
218224
if params.Parent != nil {
219225
var err error

0 commit comments

Comments
 (0)