Sneedchat: room catalogue is hardcoded, and motd/history frames are ignored #70

Closed
opened 2026-09-02 00:04:14 -04:00 by Salastil · 1 comment
Owner

Two loose ends on the most complete backend here.

Rooms. src/renderer/src/lib/sockchat.ts holds six rooms as a literal, and the comment admits it is "the fixed catalogue the account was originally configured against". The site has more, and there is no way to reach them without editing the source.

Ignored frames. The daemon logs frame carried undecoded keys - motd: null and history: bool on every connect. motd is the room's message of the day, which nothing shows. history: bool most likely marks a replayed batch — which is exactly the signal that would let a reconnect stop re-notifying, a bug this project has already had to fix by other means.

Done looks like: the room list comes from the site (or is at least editable without a rebuild), the MOTD is shown, and history suppresses notification on replay.

Two loose ends on the most complete backend here. **Rooms.** `src/renderer/src/lib/sockchat.ts` holds six rooms as a literal, and the comment admits it is "the fixed catalogue the account was originally configured against". The site has more, and there is no way to reach them without editing the source. **Ignored frames.** The daemon logs `frame carried undecoded keys - motd: null` and `history: bool` on every connect. `motd` is the room's message of the day, which nothing shows. `history: bool` most likely marks a replayed batch — which is exactly the signal that would let a reconnect stop re-notifying, a bug this project has already had to fix by other means. **Done looks like:** the room list comes from the site (or is at least editable without a rebuild), the MOTD is shown, and `history` suppresses notification on replay.
Author
Owner

Finished — and there is a way to list the rooms after all.

It is not an API. The chat page the browser loads carries the room switcher as ordinary markup — <a class="chat-room" data-id="20">Lolcows</a> — which is the same list a person sees down the side of the site. I found it with a probe that fetches the page and prints every line mentioning a room; the probe is left in place as sockchat_rooms_probe.

So the catalogue now comes from the site: seven rooms, including #lolcows (20), which was reachable by everyone using the site and by nobody using this. The display names map onto the names this project already used by lowercasing and hyphenating — a rule I checked rather than assumed, since it reproduces all six hand-written entries exactly ("SPORTS!!" → sports, "Beauty Parlor" → beauty-parlor). The built-in list stays as the fallback (with #lolcows added), because the site is behind a proof-of-work gate over Tor and the read can fail; when it does, the pane says so instead of showing a short list as though it were complete.

The read is unauthenticated — the list is the same for everybody — and happens in the background. That second part matters: it costs about fifteen seconds through Tor and the gate, and the daemon answers one request at a time per client, so a blocking answer froze the whole window while it ran. The RPC returns what was read last and a fresh read arrives as an event.

Both ignored frames are decoded. history marks the replayed batch every join carries: those messages are still stored and shown, but no longer announced — the existing duplicate check already covered the second reconnect onwards, and this covers the first, which is the one that actually fired. motd is recorded as a line in the room, once per text rather than once per connect, so a room that reconnects twice an hour does not fill with copies.

Verified live: the daemon returned all seven rooms from the site, and the account settings pane lists them.

nobilis ce6bc94, moho https://git.salastil.com/Salastil/moho/commit/4fd2e0e

Finished — and there is a way to list the rooms after all. It is not an API. The chat page the browser loads carries the room switcher as ordinary markup — `<a class="chat-room" data-id="20">Lolcows</a>` — which is the same list a person sees down the side of the site. I found it with a probe that fetches the page and prints every line mentioning a room; the probe is left in place as `sockchat_rooms_probe`. So the catalogue now comes from the site: seven rooms, including **#lolcows (20)**, which was reachable by everyone using the site and by nobody using this. The display names map onto the names this project already used by lowercasing and hyphenating — a rule I checked rather than assumed, since it reproduces all six hand-written entries exactly ("SPORTS!!" → sports, "Beauty Parlor" → beauty-parlor). The built-in list stays as the fallback (with #lolcows added), because the site is behind a proof-of-work gate over Tor and the read can fail; when it does, the pane says so instead of showing a short list as though it were complete. The read is unauthenticated — the list is the same for everybody — and happens in the background. That second part matters: it costs about fifteen seconds through Tor and the gate, and the daemon answers one request at a time per client, so a blocking answer froze the whole window while it ran. The RPC returns what was read last and a fresh read arrives as an event. Both ignored frames are decoded. `history` marks the replayed batch every join carries: those messages are still stored and shown, but no longer announced — the existing duplicate check already covered the second reconnect onwards, and this covers the first, which is the one that actually fired. `motd` is recorded as a line in the room, once per text rather than once per connect, so a room that reconnects twice an hour does not fill with copies. Verified live: the daemon returned all seven rooms from the site, and the account settings pane lists them. nobilis ce6bc94, moho https://git.salastil.com/Salastil/moho/commit/4fd2e0e
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#70