Kick and ban clients from the context menu

The client menu gains "Kick Client from Channel", "Kick Client from
Server" and "Ban Client", each asking for a reason first. Kicks use a
shared prompt that enforces the protocol's 40-character limit; the ban
dialog adds a duration, whose unit dropdown ends in "Permanent" — the
zero-length ban the server understands.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 14:29:21 +00:00
parent d37c6c9ba9
commit 0f8de796ea
6 changed files with 320 additions and 0 deletions

View File

@@ -24,6 +24,15 @@ final class ClientMenu {
poke.addActionListener(a -> actions.pokeClient(client));
menu.add(poke);
menu.addSeparator();
JMenuItem kickChannel = new JMenuItem("Kick Client from Channel", Icons.of("KICK_FROM_CHANNEL"));
kickChannel.addActionListener(a -> actions.kickClientFromChannel(client));
menu.add(kickChannel);
JMenuItem kickServer = new JMenuItem("Kick Client from Server", Icons.of("KICK_FROM_SERVER"));
kickServer.addActionListener(a -> actions.kickClientFromServer(client));
menu.add(kickServer);
JMenuItem ban = new JMenuItem("Ban Client", Icons.of("BAN_CLIENT"));
ban.addActionListener(a -> actions.banClient(client));
menu.add(ban);
boolean muted = actions.isClientLocallyMuted(client.id);
JMenuItem mute = new JMenuItem(muted ? "Unmute client" : "Mute client",
Icons.of(muted ? "PLAYER_ON" : "INPUT_MUTED"));