diff --git a/client/js/render.js b/client/js/render.js index 2cebfdb6..bfb653d2 100644 --- a/client/js/render.js +++ b/client/js/render.js @@ -144,7 +144,7 @@ function renderChannelMessages(data) { function renderChannelUsers(data) { const users = chat.find("#chan-" + data.id).find(".users"); const nicks = data.users - .concat() + .concat() // Make a copy of the user list, sort is applied in-place .sort((a, b) => b.lastMessage - a.lastMessage) .map((a) => a.nick); @@ -179,7 +179,13 @@ function renderNetworks(data) { channels: channels }) ); - channels.forEach(renderChannel); + channels.forEach((channel) => { + renderChannel(channel); + + if (channel.type === "channel") { + chat.find("#chan-" + channel.id).data("needsNamesRefresh", true); + } + }); utils.confirmExit(); sorting(); diff --git a/src/models/chan.js b/src/models/chan.js index 6ca5eb54..af4607a8 100644 --- a/src/models/chan.js +++ b/src/models/chan.js @@ -108,6 +108,7 @@ Chan.prototype.getMode = function(name) { Chan.prototype.toJSON = function() { var clone = _.clone(this); + clone.users = []; // Do not send user list, the client will explicitly request it when needed clone.messages = clone.messages.slice(-100); return clone; };