feat: add reply/quote context to messages#178
Open
Raid112 wants to merge 2 commits intolharries:mainfrom
Open
Conversation
Extract and store quoted message ID and content from WhatsApp replies. The whatsmeow library already exposes ContextInfo with StanzaId and QuotedMessage on all message types — this change captures that data and surfaces it through the MCP server. Changes: - Go bridge: new extractQuoteInfo() function covering ExtendedText, Image, Video, Audio, Document message types - SQLite schema: add quoted_message_id and quoted_content columns with ALTER TABLE migration for existing databases - Python MCP server: display "[Replying to: ...]" prefix in formatted messages, expose quote fields in all query functions
- Update whatsmeow to v0.0.0-20260305 (fixes 405 client outdated error) - Add context.Context parameter to API calls (new whatsmeow requirement) - Fix GetStanzaId -> GetStanzaID naming - Add .gitignore for compiled binary
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.
Summary
Adds reply/quote context support to both the Go bridge and Python MCP server, resolving #121.
When a WhatsApp message is a reply to another message, the original quoted content is now captured and displayed.
Changes
Go bridge (
whatsapp-bridge/main.go):QuotedMessageIDandQuotedContentfields to theMessagestructextractQuoteInfo()function that extractsContextInfofrom all message types (text, image, video, audio, document)ALTER TABLEaddsquoted_message_idandquoted_contentcolumns (safe for existing DBs)Python MCP server (
whatsapp-mcp-server/whatsapp.py):quoted_message_idandquoted_contentfields to theMessagedataclasslist_messages,get_message_context,get_last_interaction) to SELECT and populate the new fieldsformat_message()shows[Replying to: "..."]prefix when quote context is presentAlso includes:
context.ContextAPI calls (Download,sqlstore.New,GetFirstDevice,GetGroupInfo,GetContact)Test plan
CGO_ENABLED=1on Windows (MinGW)quoted_message_idandquoted_contentcolumns[Replying to: "..."]for messages with quotesCloses #121