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:
@@ -1,5 +1,6 @@
|
||||
package com.ts3client.ui;
|
||||
|
||||
import com.ts3client.net.ClientEntry;
|
||||
import com.ts3client.net.TeamspeakConnection;
|
||||
import com.ts3client.net.avatar.Avatar;
|
||||
|
||||
@@ -60,6 +61,12 @@ final class AvatarActions {
|
||||
conn.removeAvatar(error -> fail("Error deleting avatar: ", error));
|
||||
}
|
||||
|
||||
/** Deletes another client's avatar for everyone. */
|
||||
void deleteOf(ClientEntry client) {
|
||||
if (!conn.isConnected()) return;
|
||||
conn.removeAvatarOf(client, error -> fail("Error deleting avatar: ", error));
|
||||
}
|
||||
|
||||
/** Shows {@code error}, if there is one; callable from any thread. */
|
||||
private void fail(String what, String error) {
|
||||
if (error == null) return;
|
||||
|
||||
Reference in New Issue
Block a user