Commit Graph
7 Commits
Author SHA1 Message Date
erikbrockoandClaude Opus 5.5 9107bdd02e Move our own state out of TeamspeakConnection: OwnClient, Recording
OwnClient owns the microphone and speakers and our flags (mute, deafen,
away, commander, talk request, phonetic nickname, input hardware) and
publishes them; Recording owns the recorder. ServerSession reads the
flags from OwnClient instead of keeping its own copy, and they are now
cleared when a connect starts rather than once it is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:04:01 +00:00
erikbrockoandClaude Opus 5.5 959f7ed97a Frontends call the admin helpers directly, not through the connection
The channel, ban, privilege key, complaint, server log, offline message
and avatar helpers are public, each method running in the background and
answering a future; only the connection creates them. TeamspeakConnection
and ServerSession hand them out, which drops 30 one-line forwarders from
the connection. What the forwarders added moves into the helpers: the
stop-at-the-first-refusal loops, the "sent" log lines, re-reading an
edited channel's description and showing our own new avatar. The
complaint and offline message length limits move with them.

The icon chooser and the offline message composer take only their
helper; the other dialogs still need the connection for the model.

The connection's request runner is renamed Uplink, since
session.ServerLink is the ts3server:// link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:45:21 +00:00
erikbrockoandClaude Opus 5.5 da908f77bd Run server requests through ServerLink, not the whole connection
ServerLink owns what lives from one connect to its teardown: the socket,
the thread ts3j dispatches events on, the threads requests run on and
the file transfer channel. It runs requests in the background and says
whether we are connected. The *Admin helpers take it, plus the model,
permissions or avatar store where they need them, instead of the whole
TeamspeakConnection; the connection's file transfer calls share its
"not connected" check instead of repeating it.

A myTeamSpeak refresh that fails because we left meanwhile is no longer
reported, as for every other request.

Also corrects 4a's commit hash in AUDIT-STRUCTURE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:40:11 +00:00
erikbrockoandClaude Opus 5.5 1bc7eb58c1 Move the chat log and announcements out of TeamspeakConnection
ChatLog opens the on-disk log once the server is known, hands frontends
the server and channel history, and saves sent and received messages and
the server tab's log lines; with logging off, everything still reaches
the app unsaved. Announcer tells the user what happened as TeamSpeak
does: the server-tab line with linked channels and clients, the sound
pack's sound with its name variables, and errors with the matching
"insufficient permissions" or "error" sound.

ConnectionEventHandler uses both directly instead of nine helpers on the
connection, which no longer holds the sound notifier. The connection's
public API is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:11:23 +00:00
erikbrockoandClaude Opus 5.5 13e3a62042 Answer what we may do in one place: Permissions
The rules were spread over ServerSession's can* methods, ServerModel's
permits/mayHavePower/canDelete*, TeamspeakConnection and AvatarAdmin, and
Swing dialogs and Android's ServerController passed raw permission names.
Permissions now holds the server's permission table and the rules (offered
until the server says, unreported powers unknown until asked) and answers
one named question per capability. ServerSession.permissions() is the gate
for frontends: Permissions.NONE, allowing nothing, while disconnected.
ServerController's forwarding properties go the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:53:11 +00:00
erikbrockoandClaude Opus 5.5 e255a4669c Parse a client's properties once, for joins and updates alike
onClientJoin set every field and onClientChanged set the same ones again
behind presence checks, so the two drifted: a client entering as channel
commander showed as none until they toggled it, and the description they
entered with was dropped. applyClientProperties now maps each field once,
only when the event carries it, as applyChannelProperties does for
channels; the update keeps its side effects (info refresh, contacts,
unread count, announcements).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:47:34 +00:00
erikbrockoandClaude Opus 5.5 0552ed8be6 Requests return futures that fail with a typed RequestException
Server requests on TeamspeakConnection took callbacks given a value and an
error string, null on success, so frontends told a permission refusal from
other failures by the message's wording (ban list, server log) and core
needed a sentinel message for a refused search. They now return a
CompletableFuture that fails with a RequestException carrying the kind
(not connected, permission, failed) and the server's reason.

Replies hands the outcome to a success or a failure handler on a given
executor; Swing's Edt runs them on the event thread, so call sites no
longer marshal by hand. Android's ServerController, whose suspend calls
answered a String? that was null once done, returns Result instead.
lookupDatabaseClient answers an Optional rather than null.

Starts the structural audit in AUDIT-STRUCTURE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:25:07 +00:00