gateway: invisible to users, and tried again when away

Users never hear of the gateway:
- relayed messages look like everyone else's (no "via relay", no accent
  colour) and group with the author's other messages;
- a gateway that cannot be reached or drops is tried again by itself
  (after 2, 5, 15, 30, then every 60 s) with the open chats opened again
  and messages written meanwhile sent, instead of a WebSocket error
  ("connection refused") on screen; it is logged with its URL, once per
  cause;
- a server whose gateway is away is offline, not connecting, so it can
  always be joined;
- failed requests the app made by itself are quiet; what the user did and
  failed is told in plain words; query relay errors are logged;
- no status line about a found gateway; events and streams texts do not
  mention it.

The gateway is looked up once per run even when one is stored: what the
server publishes takes the place of a stored URL (one that moved, or one
typed into an older version that showed the field, which cannot be
edited any more).

The admin guide says a _tsgws record must point at TLS, not at tsgw's own
plain port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VZBWxxMsxUzp4PSTKVzbZN
This commit is contained in:
Claude committed 2026-10-05 20:09:59 +00:00
1 parent f8dcfaf0f5
commit 266148d9cd
16 files changed
+384 -78

No files matched your search

+3
View File
@@ -470,6 +470,8 @@ pub(crate) struct App {
pub demo: bool,
/// `VOELIN_DEMO_UI`: sample servers, channels and chat (dev.rs).
pub demo_ui: bool,
/// Servers whose gateway was looked up in this run (`discover_gateway`).
pub gateways_looked_up: HashSet<i64>,
/// `VOELIN_AUTOSHARE=test-pattern`: share the test pattern once streams work.
pub autoshare: bool,
/// `VOELIN_OPEN=client`: open the volume dialog of the first other client.
@@ -699,6 +701,7 @@ pub fn run(options: RunOptions) -> Result<()> {
stream_volume: 100.0,
demo: switches.demo_stream,
demo_ui: switches.demo_ui,
gateways_looked_up: HashSet::new(),
autoshare: switches.autoshare,
open_client_pending: switches.open_client,
notices_loaded: false,