From 23896456ee6c629e4337c80d8981db6d6bf1ebbf Mon Sep 17 00:00:00 2001 From: ericek111 Date: Fri, 14 Aug 2026 07:42:14 +0000 Subject: [PATCH] Stop the channel list from clearing channel icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The channellist command answers with a narrower field set than the events the server pushes while connecting, so reconciling against it wiped the icon ids those events had just delivered — leaving pre-existing channel icons invisible while a live icon change still showed up. Treat a missing or blank icon there as "not reported" rather than "no icon"; only the edit event, which lists exactly what changed, may clear one. Co-Authored-By: Claude Opus 5 --- .../com/ts3client/net/TeamspeakConnection.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java b/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java index 0d6d39c..0c73640 100644 --- a/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java +++ b/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java @@ -316,10 +316,11 @@ public final class TeamspeakConnection implements TS3Listener { node.permanent = ch.isPermanent(); node.topic = ch.getTopic() == null ? "" : ch.getTopic(); node.maxClients = ch.getMaxClients(); - // channellist omits the icon on some servers; keep what events gave us. - if (ch.get("channel_icon_id") != null) { - node.iconId = safeLong(ch.get("channel_icon_id")); - } + // The channellist command answers with a narrower field set than the + // events do, so a missing (or blank) icon here means "not reported", + // not "no icon" — never let it clear what the events delivered. + long icon = safeLong(ch.get("channel_icon_id")); + if (icon != 0) node.iconId = icon; } } } catch (Exception e) { @@ -612,7 +613,8 @@ public final class TeamspeakConnection implements TS3Listener { if (pid == 0) pid = safeInt(e, "pid"); int order = safeInt(e, "channel_order"); ChannelNode node = model.putChannel(cid, name, pid, order); - node.iconId = safeLong(e, "channel_icon_id"); + long icon = safeLong(e, "channel_icon_id"); + if (icon != 0) node.iconId = icon; model.relinkChannel(cid, pid, order); ui.onModelChanged(); } @@ -653,7 +655,9 @@ public final class TeamspeakConnection implements TS3Listener { String name = e.get("channel_name"); int pid = safeInt(e, "cpid"); int order = safeInt(e, "channel_order"); - model.putChannel(cid, name, pid, order).iconId = safeLong(e, "channel_icon_id"); + ChannelNode node = model.putChannel(cid, name, pid, order); + long icon = safeLong(e, "channel_icon_id"); + if (icon != 0) node.iconId = icon; } @Override