Fix message/reply endpoint with a @lid contactId (#121)

Avoid adding a contactId '@c.us' postfix if a '@lid' postfix exists, to support @lid ids as well

Co-authored-by: nir <nir@severin>
This commit is contained in:
Nir 2026-04-02 22:30:48 +03:00 • committed by GitHub
commit 31e9412301
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -519,7 +519,10 @@ const reply = async (req, res) => {
break
}
case 'Contact': {
const contactId = content.contactId.endsWith('@c.us') ? content.contactId : `${content.contactId}@c.us`
const contactId =
content.contactId.endsWith('@c.us') || content.contactId.endsWith('@lid')
? content.contactId
: `${content.contactId}@c.us`;
contentMessage = await client.getContactById(contactId)
break
}