Add an away button with global actions and message presets

The toolbar gains an away toggle with a drop-down: it toggles away on the
current server with no message, while the menu carries the global actions
("Set Globally Away", "Set Globally Away Status"), the saved presets and
their editor. Presets live in ~/.ts3jclient/away.properties and are
managed in a list with add/remove and double-click renaming.

Clients in the channel tree now show their away message in brackets after
the nickname instead of their primary server group.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 13:40:19 +00:00
parent 25a78f52fe
commit 245ae5ecc5
9 changed files with 491 additions and 18 deletions

View File

@@ -49,6 +49,8 @@ final class ServerTab implements ConnectionListener, ServerTreePanel.Actions {
private boolean micMuted;
private boolean deafened;
private boolean away;
/** Away message currently published, empty when away carries no message. */
private String awayMessage = "";
private boolean commander;
private Object currentSelection;
@@ -143,6 +145,10 @@ final class ServerTab implements ConnectionListener, ServerTreePanel.Actions {
return away;
}
String awayMessage() {
return awayMessage;
}
boolean isCommander() {
return commander;
}
@@ -223,9 +229,16 @@ final class ServerTab implements ConnectionListener, ServerTreePanel.Actions {
conn.setMicrophoneActive(active);
}
/**
* @param message the away message, or null to keep the one already set — the
* message outlives coming back, so toggling away again restores it
*/
void setAway(boolean away, String message) {
this.away = away;
conn.setAway(away, message);
if (message != null) this.awayMessage = message;
conn.setAway(away, awayMessage);
chatPanel.appendSystem(!away ? "No longer away."
: awayMessage.isEmpty() ? "Away." : "Away: " + awayMessage);
}
void setCommander(boolean commander) {
@@ -394,6 +407,7 @@ final class ServerTab implements ConnectionListener, ServerTreePanel.Actions {
micMuted = false;
deafened = false;
away = false;
awayMessage = "";
commander = false;
chatPanel.setInputEnabled(true);
chatPanel.appendSystem("Connected.");