Skip to content

feat(baileys): populate body with vCard for inbound contact shares - #1436

Merged
rmyndharis merged 1 commit into
rmyndharis:mainfrom
memarius:feat/baileys-inbound-contact-vcard-body
Aug 23, 2026
Merged

feat(baileys): populate body with vCard for inbound contact shares#1436
rmyndharis merged 1 commit into
rmyndharis:mainfrom
memarius:feat/baileys-inbound-contact-vcard-body

Conversation

@memarius

@memarius memarius commented Aug 23, 2026

Copy link
Copy Markdown

Description

Baileys silently dropped the text of a shared contact card: neither contactMessage nor contactsArrayMessage was read by extractBaileysBody, so the neutral body field stayed empty even though whatsapp-web.js already returns the raw vCard for its vcard type. Several contacts shared together are newline-joined into one multi-vCard body, in the order they were shared (RFC 6350 allows concatenated vCards in one stream).

  • A single contactMessage contributes its vCard as-is, matching the body whatsapp-web.js produces for vcard.
  • A contactsArrayMessage (several contacts shared together) has its vCards newline-joined, in the order they were shared - a valid single multi-vCard body per RFC 6350. whatsapp-web.js leaves a multi_vcard body empty, so this case is a Baileys extension rather than parity.
  • Falls through to '' when neither is present, same as every other body source in
    this function.

Message type classification (contactMessage/contactsArrayMessagecontact)
already existed in message-mapper.ts; this fixes the body text that goes with it.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Tests added/updated
  • Documentation updated (CHANGELOG [Unreleased])
  • Lint passes
  • Self-reviewed

Screenshots (if applicable)

N/A - mapper-level change, no UI impact.

Related Issues

@rmyndharis
rmyndharis force-pushed the feat/baileys-inbound-contact-vcard-body branch from c085c72 to a0e861d Compare August 23, 2026 11:32
@rmyndharis rmyndharis changed the title feat(baileys): populate body with vCard for inbound contact shares feat(baileys): populate body with vCard for inbound contact shares Aug 23, 2026
Baileys silently dropped the text of a shared contact card: neither contactMessage
nor contactsArrayMessage was read by extractBaileysBody, so the neutral body field
stayed empty even though whatsapp-web.js already returns the raw vCard for its
vcard type. Several contacts shared together are newline-joined into one multi-vCard
body, in the order they were shared (RFC 6350 allows concatenated vCards in one
stream); whatsapp-web.js leaves multi_vcard bodies empty, so that case is a Baileys
extension rather than parity.
@rmyndharis
rmyndharis force-pushed the feat/baileys-inbound-contact-vcard-body branch from a0e861d to fe24d1c Compare August 23, 2026 11:35
@rmyndharis
rmyndharis merged commit acb9afb into rmyndharis:main Aug 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants