feat: support @mentions in the send message API - #321
Open
EmilioNicolas wants to merge 1 commit into
Open
Conversation
Author
|
Correction from live testing: the API field itself populates ContextInfo.MentionedJID, but clients do not replace visible @phone text with the sender contact name. Also, visible phone text paired with @lid metadata rendered as underlined phone numbers rather than named mentions. The PR description should not claim automatic contact-name substitution. I am investigating the exact payload used by official clients before recommending production use. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds optional
mentionssupport to the bridge'sPOST /api/sendendpoint, so text messages can tag users with real WhatsApp mentions (blue, tappable, resolved to each recipient's contact name) instead of plain "@Number" text.How
mentions: []stringinSendMessageRequest(accepts phone numbers or full JIDs; numbers are normalized to<number>@s.whatsapp.net).ExtendedTextMessagewithContextInfo.MentionedJIDset (this is the metadata official clients attach for mentions). Without mentions, behaviour is unchanged (plainConversationmessage).Usage
The message text should include "@" for each mentioned user; WhatsApp clients render it using each viewer's own contact list.
Notes
mentionsis optional, existing calls unchanged.