Let admins delete other clients' avatars

With b_client_avatar_delete_other, the client's context menu and the
menu on their avatar offer "Delete Avatar", as in TeamSpeak 3. The
server takes the deletion as ftdeletefile on /avatar_<unique id> (not
the stored file's name, which it refuses with "convert error") and
clears the client's avatar flag for everyone. Our own avatar's file is
now deleted the same way, which only such clients are allowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 16:27:41 +00:00
parent b1890cbf79
commit bda114d2c0
9 changed files with 80 additions and 1 deletions

View File

@@ -74,6 +74,11 @@ final class ClientMenu {
JMenuItem description = new JMenuItem("Change Description", Icons.of("EDIT"));
description.addActionListener(a -> actions.changeClientDescription(client));
menu.add(description);
if (!self && !client.avatarFlag.isEmpty() && actions.canDeleteOtherAvatars()) {
JMenuItem avatar = new JMenuItem("Delete Avatar", Icons.of("DELETE_AVATAR_OTHER"));
avatar.addActionListener(a -> actions.deleteClientAvatar(client));
menu.add(avatar);
}
JMenuItem info = new JMenuItem("Connection Info", Icons.of("INFO"));
info.addActionListener(a -> actions.showConnectionInfo(client));
menu.add(info);