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