Discord/Spotify-style now playing, served by the new Lotus now-playing
service (matrix repo, now-playing/):
- Profile popout: a "Listening to" card (cover, track, artist, album,
live progress); member list: a 🎵 line when the member has no typed
status. Data comes from GET /now-playing/v1/users, batched across all
visible users and polled every 20 s while the page is visible.
- Settings → Profile: "Share what I'm listening to", off by default,
stored by the service (GET/PUT /v1/me). Auth is a Matrix OpenID token.
- Status text: while Lotus is open and sharing, the Matrix status shows
"🎵 Artist – Track" so other clients see it, but only when the user has
no typed status, and never in DND/Invisible. The typed status and its
auto-clear are never touched. The music text uses a thin space after
the note, and every device reads it as "no typed status"
(pickHeartbeatStatus, Profile sync), so it can't be adopted as the
user's status. Clearing or auto-clearing a status falls back to the
music; closing the window drops it (pagehide sends the typed status).
- config.json: nowPlaying → https://matrix.lotusguild.org/now-playing.
Tests: nowPlaying.test.ts (format, marker, priority matrix, position,
config/cover URLs) and a heartbeat case in ownStatusSync.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
Lotus encodes DND as status_msg "dnd". After switching back to Auto, the
heartbeat read the server's status, adopted "dnd" as the user's own and
kept re-sending it, so the custom status was lost and other clients kept
showing "dnd"; the Settings status field showed "dnd" too.
pickHeartbeatStatus (unit-tested) never adopts the "dnd" sentinel and
falls back to the device's real status; Profile neither mirrors it into
the local status nor shows it in the field.
Verified on the local Synapse: "🎮 Gaming" → DND (unavailable/dnd) → Auto
→ online/"🎮 Gaming" (before: online/"dnd").
Still open in #283: while in DND other clients show the literal "dnd";
that needs MSC3026 busy presence on the homeserver (matrix#19).
Refs #283
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
Status messages are saved per device and re-sent with every presence
heartbeat (a presence write without status_msg clears it on Synapse). A
device never receives its own user's presence changes made on other
devices, so the DP3 fix in db864326 — mirroring remote changes from the
Profile page — could never fire: device B kept a status that device A had
cleared and re-published it on its next state change.
Heartbeats now reconcile with the server first: GET our own presence,
send the server's current status_msg and bring the local copy in line.
Falls back to the local copy when the read fails, when the server shows
us offline (invisible mode clears the status by design), and for 15 s
after this device saved/cleared its own status (a server read that
hasn't caught up yet can't override a fresh save).
Verified with two sessions of the same user against local Synapse:
B sets "dp3 old status" → A clears it → B goes hidden→visible → server
stays "" and B's local copy is removed (before: back to "dp3 old status").
A sets "dp3 new from A" → B heartbeat keeps it and adopts it locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA