Skip to content

Add history sync, send files, and chat details#24

Merged
toloco merged 3 commits into
mainfrom
feature-media-history
Apr 9, 2026
Merged

Add history sync, send files, and chat details#24
toloco merged 3 commits into
mainfrom
feature-media-history

Conversation

@toloco
Copy link
Copy Markdown
Owner

@toloco toloco commented Apr 9, 2026

Summary

Three major features that close the gap with competitors:

History sync (#20)

  • Handles *events.HistorySync to load past messages on connect
  • Tested: 15,940 messages synced on first connect
  • Messages stored in SQLite, available immediately

Send files (#22)

  • New send_file tool: send images, videos, documents, audio
  • Uses whatsmeow Upload() + SendMessage() with proper media types
  • Auto-detects MIME type from file extension
  • Optional caption for images/videos

Get chat detail (#23)

  • New get_chat tool: detailed group info
  • Shows: name, topic, participants with admin status, creation date, message count
  • Works for both groups and DMs

Also

  • media_type field added to stored messages (schema auto-migrates)
  • extractText refactored to also return media type

Closes #20, #22, #23. #21 (media download) is tracked separately.

Tools (now 6)

Tool New?
send_message
list_chats
get_messages
search_contacts
get_chat NEW
send_file NEW

Test plan

  • make build passes
  • whasapo serve syncs ~15k messages on connect
  • get_chat returns group details with participants
  • send_file sends an image to a contact

toloco added 3 commits April 9, 2026 12:33
- sync past messages via whatsmeow HistorySync events on connect
- send_file tool: upload and send images, videos, docs, audio
- get_chat tool: detailed group info with participants and topic
- media_type field on stored messages for future download support
- schema migration: adds media_type column to existing databases

closes #20 #22 #23
store raw protobuf for media messages in a media_proto column.
new download_media tool decrypts and saves media to ~/.whasapo/media/
using whatsmeow's Download(). supports images, videos, documents,
audio, and stickers.

proto is stored for both live messages and history sync, so media
can be downloaded after the fact.

closes #21
37 tests covering:
- extractTextAndMedia: all message types (text, image, video, doc,
  audio, sticker, location, contact, poll, nil, unsupported)
- contactName: fallback chain
- truncate: edge cases
- extensionFromMime: known/unknown types
- semverGreater: 15 cases including multi-digit segments
- SQLite: store, query, filter, upsert, media type, download errors

new test.yml workflow runs on push to main and all PRs.
release.yml now runs tests before building.
removed stale commit_helper files.
@toloco toloco merged commit ec5633b into main Apr 9, 2026
1 check passed
@toloco toloco deleted the feature-media-history branch April 9, 2026 12:08
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.

Sync message history on first connect

1 participant