Repository navigation
feat(messages): announce messages missed while the phone was away - #324
Open
aashish-thapa wants to merge 2 commits into
Open
aashish-thapa wants to merge 2 commits into
aashish-thapa wants to merge 2 commits into
Conversation
When a MAP session opens, the first listing brings in what arrived while the iPhone was disconnected. Those messages reached the Messages view but never raised a desktop popup, so a phone that came back into range caught up silently, unlike an iPad or Mac. The connection manager now hands the backfill to the daemon as one batch, along with the newest timestamp it held before the listing. The daemon announces the messages that are newer than that and still unread on the phone: up to three get a popup each, and more become one summary naming the conversations. With no history held (a first sync, or a journal that could not be read) nothing is announced, since nothing tells new from old. Batched popups go through the same rules as live ones (hidden threads, unknown senders, reply eligibility), which move out of main.cpp into message_popups.cpp so both paths share them. Codes are not offered: one that arrived while away has likely expired. On by default, behind a "Show messages missed while away" switch in the GTK and TUI settings (set_missed_message_popups).
This branch has not been deployed
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
When the iPhone comes back into range, the messages that arrived while it was away now raise desktop popups, the way an iPad or Mac catches up after being offline. Before this they showed up in the Messages view silently: the first MAP listing after a session opens is flagged
backfill, and the daemon skipped popups for all of it.That flag was there to keep a first sync from popping up the whole inbox. Now that history persists in the journal, a reconnect's backfill is usually just what you missed, so this change tells the two cases apart instead of silencing both.
hide_unknown_senders, the global popup switch and previews all apply.How
ConnectionManager::set_backfill_handler: after a backfill listing that added anything, the connection manager passes the new messages as one batch, plusnewest_known(the newest timestamp the store held before the listing, empty if none). Per-messageMessageFndelivery is unchanged, so the UI still gets everybt_message.tether/bluetooth/catch_up.hpp:plan_catch_up()is a pure function that drops anything not newer thannewest_known, then returns eitherCatchUpEach(oldest first, so the newest ends up on top) orCatchUpSummary(count plus the newest message of each conversation). Unit tested intest_catch_up.cpp.src/daemon/message_popups.cpp: the "does this message get a popup, and what does it look like" logic moves out ofmain.cppunchanged, so live messages and the catch-up batch share one copy of it.MessageStore::newest_timestamp()gives the baseline.missed_message_popupsin the config and inbt_status, plus theset_missed_message_popupscommand, documented indocs/PROTOCOL.md.po/tether.potregenerated. The five new strings are filled into all 15 catalogs, with each language's plural forms, soi18n.ymlstays green. Like the rest of the catalogs these are machine-assisted drafts.Testing
ctest: 649/649 pass, including the newCatchUp.*andMessageStore.ReportsTheNewestTimestampHeldtests,po_templateandpo_catalogs.po/update-pot.sh --checkandpo/check-catalogs.shpass.🤖 Generated with Claude Code