Move a client into your own channel from its context menu

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 15:00:02 +00:00
committed by ericek111
parent 6dee5106c7
commit 97148cfe9a
3 changed files with 16 additions and 0 deletions

View File

@@ -47,6 +47,12 @@ final class ClientMenu {
JMenuItem info = new JMenuItem("Connection Info", Icons.of("INFO"));
info.addActionListener(a -> actions.showConnectionInfo(client));
menu.add(info);
if (!self) {
menu.addSeparator();
JMenuItem moveHere = new JMenuItem("Move Client to own Channel", Icons.of("MOVE_CLIENT_TO_OWN_CHANNEL"));
moveHere.addActionListener(a -> actions.moveClientToOwnChannel(client));
menu.add(moveHere);
}
return menu;
}
}

View File

@@ -380,6 +380,13 @@ final class ServerTab implements ConnectionListener, ServerTreePanel.Actions {
new ConnectionInfoDialog(host, conn, client.id, client.nickname).setVisible(true);
}
@Override
public void moveClientToOwnChannel(ClientEntry client) {
if (!conn.isConnected() || client.id == conn.getSelfClientId()) return;
ClientEntry self = conn.getModel().getClient(conn.getSelfClientId());
if (self != null) conn.moveClient(client.id, self.channelId, null);
}
@Override
public void setChannelSubscribed(ChannelNode channel, boolean family, boolean subscribed) {
if (conn.isConnected()) conn.setChannelsSubscribed(channel.familyIds(family), subscribed);

View File

@@ -57,6 +57,9 @@ public final class ServerTreePanel extends JScrollPane {
void showConnectionInfo(ClientEntry client);
/** Moves a client into the channel we are currently in. */
void moveClientToOwnChannel(ClientEntry client);
/** Open the file repository browser for a channel. */
void browseFiles(ChannelNode channel);