fix(presence): Do Not Disturb is real "busy" presence and keeps your status (#283) #424

Merged
jared merged 1 commits from fix/dnd-busy-presence into lotus 2026-10-19 02:44:21 -04:00
Owner

Fixes #283 (decision 2026-10-19: enable busy presence). Production Synapse is being switched on separately (experimental_features.msc3026_enabled).

Before: Do Not Disturb sent presence unavailable with the literal status text dnd. It replaced your status ("🎮 Gaming" → "dnd"), and Element/FluffyChat showed "dnd".

Change

  • Where the server advertises org.matrix.msc3026.busy_presence, DND sends presence org.matrix.msc3026.busy and keeps your status. Synapse doesn't let /sync's set_presence=online override busy, so the sync loop stays online.
  • Servers without it keep the legacy encoding, and the client detects support at runtime.
  • Rendering: a new Presence.Busy shows red with the label "Do Not Disturb" and keeps the real status line (badge, ring, labels). The legacy unavailable + dnd is still recognised (isDndPresence), so DND from older Lotus clients still shows correctly.
  • presenceStateFromSetting('dnd') returns busy when supported, so saving, clearing or auto-clearing a status doesn't downgrade DND to "unavailable".
  • matrix-js-sdk's setPresence rejects non-spec values ("Bad presence value"), so busy goes through writePresence, a direct authed PUT /presence/{user}/status.

Verified (local Synapse with msc3026_enabled):

  • Bob sets "🎮 Gaming", then DND, then Auto: online/"🎮 Gaming" → org.matrix.msc3026.busy/"🎮 Gaming" → online/"🎮 Gaming". Before: online/"dnd" while in DND.
  • Main viewing Bob's profile while busy: red dot and ring, badge label "Do Not Disturb — 🎮 Gaming", status line kept.

Unit tests for isDndPresence. tsc clean · unit tests pass · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #283 (decision 2026-10-19: enable busy presence). Production Synapse is being switched on separately (`experimental_features.msc3026_enabled`). **Before:** Do Not Disturb sent presence `unavailable` with the **literal status text `dnd`**. It replaced your status ("🎮 Gaming" → "dnd"), and Element/FluffyChat showed "dnd". **Change** - Where the server advertises `org.matrix.msc3026.busy_presence`, DND sends presence **`org.matrix.msc3026.busy`** and **keeps your status**. Synapse doesn't let `/sync`'s `set_presence=online` override busy, so the sync loop stays online. - Servers without it keep the legacy encoding, and the client detects support at runtime. - **Rendering:** a new `Presence.Busy` shows red with the label "Do Not Disturb" and keeps the real status line (badge, ring, labels). The legacy `unavailable` + `dnd` is still recognised (`isDndPresence`), so DND from older Lotus clients still shows correctly. - `presenceStateFromSetting('dnd')` returns busy when supported, so saving, clearing or auto-clearing a status doesn't downgrade DND to "unavailable". - matrix-js-sdk's `setPresence` rejects non-spec values ("Bad presence value"), so busy goes through `writePresence`, a direct authed `PUT /presence/{user}/status`. **Verified** (local Synapse with `msc3026_enabled`): - Bob sets "🎮 Gaming", then DND, then Auto: `online/"🎮 Gaming"` → **`org.matrix.msc3026.busy/"🎮 Gaming"`** → `online/"🎮 Gaming"`. Before: `online/"dnd"` while in DND. - Main viewing Bob's profile while busy: red dot and ring, badge label **"Do Not Disturb — 🎮 Gaming"**, status line kept. Unit tests for `isDndPresence`. `tsc` clean · unit tests pass · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-19 01:05:08 -04:00
fix(presence): Do Not Disturb is real "busy" presence and keeps your status (#283)
CI / Build & Quality Checks (pull_request) Successful in 1m52s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 8s
CI / Playwright smoke (e2e) (pull_request) Successful in 10m59s
00f962a463
DND was sent as presence unavailable with the literal status text
"dnd": it replaced your status, and other clients showed "dnd". Where
the server supports MSC3026 (busy_presence), DND now sends presence
org.matrix.msc3026.busy and leaves the status alone (Synapse keeps
busy across /sync set_presence=online). Busy renders as red "Do Not
Disturb" with the real status line; the legacy unavailable + "dnd"
encoding is still recognised and still used on servers without it.
Status saves / clears no longer downgrade busy. The SDK rejects
non-spec presences, so busy goes through a direct authed PUT.

Fixes #283

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit aaa915fe6b into lotus 2026-10-19 02:44:21 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#424