Show and control channel subscriptions

Track the subscription state from the notifychannelsubscribed events, draw
subscribed and unsubscribed channels apart with the pack's icons (and the
built-in glyph as a hollow cone), and offer subscribe/unsubscribe entries —
channel and family — in the channel context menu.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 13:57:25 +00:00
parent 245ae5ecc5
commit 46206e3047
6 changed files with 183 additions and 17 deletions

View File

@@ -53,6 +53,13 @@ public final class ServerTreePanel extends JScrollPane {
/** Open the file repository browser for a channel. */
void browseFiles(ChannelNode channel);
/**
* Changes a channel's subscription.
*
* @param family whether the channels below it are included
*/
void setChannelSubscribed(ChannelNode channel, boolean family, boolean subscribed);
boolean isClientLocallyMuted(int clientId);
/** A channel or client node was selected (or {@code null} when cleared). */
@@ -606,9 +613,9 @@ public final class ServerTreePanel extends JScrollPane {
}
private ImageIcon iconFor(ChannelNode c) {
if (c.hasPassword) return Icons.channelLocked();
if (c.maxClients >= 0 && c.clients.size() >= c.maxClients) return Icons.channelFull();
return Icons.channel();
if (c.hasPassword) return Icons.channelLocked(c.subscribed);
if (c.maxClients >= 0 && c.clients.size() >= c.maxClients) return Icons.channelFull(c.subscribed);
return Icons.channel(c.subscribed);
}
/** The client's state, in the order the official client gives them priority. */