feat: SSE pub/sub stream, resolve-contacts endpoint, and LID phone number fix#191
Open
Stupidoodle wants to merge 2 commits intolharries:mainfrom
Open
feat: SSE pub/sub stream, resolve-contacts endpoint, and LID phone number fix#191Stupidoodle wants to merge 2 commits intolharries:mainfrom
Stupidoodle wants to merge 2 commits intolharries:mainfrom
Conversation
…erver scaffold Go bridge (whatsapp-bridge/main.go): - Update whatsmeow to latest, fix all context.Context API changes - Add stealth mode: no auto read receipts, no auto presence - Add events table for receipts, typing indicators - Add REST endpoints: /api/mark-read, /api/typing, /api/presence, /api/resync - Store sent messages at send time (fix LID echo issue) - Fix audio filename collisions (prepend message ID) - Fix contact name resolution for LID-based JIDs (PushName/BusinessName fallbacks) - Filter self-receipts from events table Python MCP server (whatsapp-mcp-server/): - Add tools: get_chat_log, wait_for_reply, send_and_check, transcribe_audio - Add stealth tools: get_events, mark_read, send_typing, set_presence - Add resync_chats tool - Fix wait_for_reply: rolling grace period, manual activity detection - Add openai and python-dotenv dependencies DM skill templates (templates/): - Full autonomous DM skill with /dm slash command - Protocol files: loop, reconnaissance, planning, resume - Template files: identity, target, history, strategy, memory - Setup script (dm-setup.sh) for one-command project creation - Pre-configured .mcp.json and settings.local.json Channel server scaffold (whatsapp-channel/): - Bun project initialized with MCP SDK and zod - Placeholder for event-driven channel implementation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e number fix - Add GET /api/stream SSE endpoint that broadcasts all WhatsApp events (messages, receipts, presence) to connected subscribers in real-time. Enables event-driven integrations without polling. - Add POST /api/resolve-contacts endpoint that bulk-resolves LID contact names. Fixes the issue where LID-based contacts show as numeric IDs instead of real names. Collects unresolved JIDs before closing the DB cursor to avoid SQLite locking issues during writes. - Fix search_contacts to show real phone numbers for LID contacts by joining against whatsmeow_lid_map table. Previously showed the raw LID numeric part as "phone_number" which was misleading. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
SSE pub/sub stream (
GET /api/stream): Real-time broadcast of all WhatsApp events (messages, receipts, typing, presence) via Server-Sent Events. Multiple subscribers supported. Enables event-driven integrations without polling — justcurl -N http://localhost:8080/api/streamto debug.Resolve contacts (
POST /api/resolve-contacts): Bulk-resolves LID contact names. LID-based contacts (WhatsApp's privacy-obfuscated IDs) are stored with numeric-only names in the DB. This endpoint looks up real names from the WhatsApp contact store and persists them. Fixes the root cause ofsearch_contactsreturning no results for contacts stored as LIDs. Collects all unresolved JIDs before closing the DB cursor to avoid SQLite locking delays (~5s per write).LID phone number fix in
search_contacts: For@lidcontacts, shows the real phone number by joining againstwhatsmeow_lid_mapinstead of the meaningless LID numeric part.Test plan
curl -N http://localhost:8080/api/stream— should receive events as messages arrivePOST /api/resolve-contacts— should return{"resolved": N, ...}and update LID contact names in DBsearch_contacts("name")should find them with real phone number🤖 Generated with Claude Code