fix(client): derive voice status from a single state machine

The status bar and voice page kept saying the room was being joined while
the sidebar already reported a connected voice. Clicking the room you were
already in set a free-text 'joining' message that nothing cleared, because
the server does not answer a repeated join, and the voice page showed its
joining label whenever the member list was empty.

Joining is now an explicit voice state. The sidebar, the voice page and the
status text all read one derived status; a repeated click only shows the
room, and a server error cancels a pending join.
This commit is contained in:
Loki 2026-10-25 09:50:11 +01:00
parent 69d108b090
commit 7d488faf59
Signed by: boba
GPG key ID: 253067914055423B
9 changed files with 153 additions and 14 deletions

View file

@ -43,7 +43,7 @@ impl State {
if source != state.endpoint {
// A relay answering from another address looks exactly like silence.
rejected += 1;
if rejected == 1 || rejected % 500 == 0 {
if rejected == 1 || rejected.is_multiple_of(500) {
tracing::warn!(
%source,
expected = %state.endpoint,
@ -58,7 +58,7 @@ impl State {
Ok(decoded) => decoded,
Err(error) => {
rejected += 1;
if rejected == 1 || rejected % 500 == 0 {
if rejected == 1 || rejected.is_multiple_of(500) {
tracing::warn!(%error, rejected, "voice datagram rejected");
}
continue;