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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user