Skip to content

feat: add opt-in starred-contact DND bypass with settings toggle - #3064

Open
blue-archon wants to merge 1 commit into
BlueBubblesApp:masterfrom
blue-archon:pr-dnd
Open

blue-archon wants to merge 1 commit into
BlueBubblesApp:masterfrom
blue-archon:pr-dnd

Conversation

@blue-archon

@blue-archon blue-archon commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds an opt-in "Override DND for Favorites" toggle (default off) in Notification Settings. When enabled, a message from a starred/favorite Android contact breaks through Do Not Disturb; non-favorites follow normal DND.

How

Replaces the global channel.setBypassDnd(true) on the New Messages channel (and the per-conversation settings channel), which bypassed DND for every sender, with per-notification logic: when the sender resolves to a starred contact, the notification Person is built with setUri(lookupUri) plus setImportant so Android's own DND rules grant the exception contact by contact.

A new ContactNotificationHelper resolves the lookup URI and starred status. nativeContactId is resolved in Dart from the sender's ContactV2 and passed with the toggle through the create-incoming-message-notification channel, so there is no extra native contacts query and no SharedPreferences dependency.

Stacked on #3062.

@blue-archon

Copy link
Copy Markdown
Contributor Author

Rebased onto current development and simplified: settings are now natively readable and the sender Person is already built in CreateIncomingMessageNotification, so I dropped the SharedPreferences workarounds from the earlier version. About 10 files instead of 21.

@jjoelj
jjoelj changed the base branch from development to master July 27, 2026 03:15
@blue-archon

Copy link
Copy Markdown
Contributor Author

Rebased onto current master. Two things worth flagging:

  • Resolved the notification-panel conflict from the settings rewrite. The "Override DND for Favorites" toggle now sits inside the new Obx-wrapped SettingsSection.
  • Unstacked this from fix: don't hide group messages when the participant list is stale #3062. They touch disjoint files, so this is now just the DND feature on its own and can be reviewed independently.

@blue-archon

Copy link
Copy Markdown
Contributor Author

Rebased onto v2.1.0, applies cleanly. This is the fork's headline feature, and I'd like to land it upstream so the fork can shrink. It uses Android's native starred-contact DND exception instead of putting the whole channel on the override list. Happy to adjust the approach if you'd like changes.

Adds an opt-in Override DND for Favorites toggle (default off) in Notification Settings. When enabled, a message from a starred/favorite Android contact breaks through Do Not Disturb while non-favorites follow normal DND. This replaces the previous global channel.setBypassDnd(true) on the New Messages channel and the per-conversation settings channel, which bypassed DND for every sender.

Per notification, when the sender resolves to a starred contact the notification Person is built with setUri(lookupUri) plus setImportant so Android's own DND rules grant the exception contact by contact. A new ContactNotificationHelper resolves the lookup URI and starred status; nativeContactId is resolved in Dart from the sender's ContactV2 and passed with the toggle through the create-incoming-message-notification channel.

This branch has not been deployed

No deployments
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.

Honor the DnD started contacts to send notifications during DnD time

1 participant