Bookmarks: "this channel" button instead of the channel's "Add to bookmarks"

The bookmark editors (desktop dialog, Android screen) get TeamSpeak's
button beside the default channel, with its MAKE_CURRENT_CHANNEL_DEFAULT
icon: it takes the channel we are in, enabled while we are on the server
the form's address and port lead to (Sessions.connectedTo). The Android
channel sheet drops "Add to bookmarks"; the server sheet keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 21:03:04 +00:00
co-authored by Claude Opus 5.5
parent 173e710960
commit 3948db69bb
7 changed files with 86 additions and 14 deletions
@@ -45,6 +45,15 @@ public final class Sessions {
assignMicrophoneIfFree();
}
/** The session connected to the server at {@code address}:{@code port}, or null when we are not on it. */
public ServerSession connectedTo(String address, int port) {
if (address == null) return null;
for (ServerSession s : sessions) {
if (s.isConnected() && s.port() == port && address.trim().equalsIgnoreCase(s.address())) return s;
}
return null;
}
public boolean anyConnected() {
for (ServerSession s : sessions) {
if (s.isConnected()) return true;