Conversation
Implement a sync-imessage command that reads from macOS's ~/Library/Messages/chat.db and imports messages into the msgvault archive using the existing sync infrastructure. New files: - internal/imessage/client.go: gmail.API implementation over chat.db - internal/imessage/parser.go: MIME builder, timestamp conversion - internal/imessage/models.go: chat.db row types - internal/imessage/parser_test.go: tests for parsing utilities - cmd/msgvault/cmd/sync_imessage.go: CLI command Uses existing SourceType field in sync.Options (added by IMAP support).
roborev: Combined Review (
|
- Parse --after/--before dates with time.ParseInLocation for local timezone instead of UTC (fixes midnight boundary off-by-one) - Switch GetMessagesRawBatch from pre-allocated indexed slice to append-based, eliminating nil entries on fetch errors - Log Warn when messages have attachments that won't be archived (attachment extraction not yet implemented)
|
Addressed roborev feedback in 3357a07: High — attributedBody (line 266, 295): Already handled — High — attachments (line 258, 301): Added Medium — date filter timezone (line 80, 88): Switched Medium — nil entries in batch (line 340): Changed |
roborev: Combined Review (
|
- Decode attributedBody as fallback when message.text is NULL (macOS Ventura+ stores content exclusively in NSKeyedArchiver blob) - Hash iMessage GUIDs for Message-ID header (raw GUIDs contain ':' and '/' which are invalid in RFC 5322 msg-id local-part) - Make messageRow.Service nullable (*string) to handle NULL service column on system messages instead of failing Scan - Add extractAttributedBodyText with NSKeyedArchiver plist decoder - Add tests for attributedBody extraction and Message-ID sanitization
|
Addressed round-2 roborev feedback in 26d2a2d: Blank-body imports (attributedBody): Added Invalid Message-ID from raw GUIDs: iMessage GUIDs like NULL service column: Changed |
|
Since we now have WhatsApp, iMessage, and Google Voice PRs I’m going to review all there and make sure the storage layer is coherent and I will work on getting them merged one by one, but just bear with me! |
|
Stumbling on this repo really helped clear up a lot of my backlog and unlocked a bunch of stuff for me, thank you so much for creating this! I'm so stoked for my first contribution! |
roborev: Combined Review (
|
Summary
sync-imessagecommand that reads macOS~/Library/Messages/chat.dband imports messages into msgvaultgmail.APIinterface over SQLite chat.db for plug-and-play integration with existing sync infrastructureSourceTypefield in sync.Options (added by IMAP support)New files
internal/imessage/client.go- gmail.API implementation over chat.dbinternal/imessage/parser.go- MIME builder, timestamp conversioninternal/imessage/models.go- chat.db row typesinternal/imessage/parser_test.go- tests for parsing utilitiescmd/msgvault/cmd/sync_imessage.go- CLI commandUsage
Tested against macOS Messages database with ~10k conversations.