diff --git a/code/chat.js b/code/chat.js index 2bcf5f79..50cb8fec 100644 --- a/code/chat.js +++ b/code/chat.js @@ -228,12 +228,12 @@ window.chat.renderCompact = function(oldMsgsWereAdded) { $.each(chat._public.data, function(guid, entry) { // skip player msgs if(!entry[1]) return true; - var pguid = entry[3]; + var nick = entry[3]; // ignore if player has newer data - if(data[pguid] && data[pguid][0] > entry[0]) return true; - data[pguid] = entry; + if(data[nick] && data[nick][0] > entry[0]) return true; + data[nick] = entry; }); - // data keys are now player guids instead of message guids. However, + // data keys are now player nicks instead of message guids. However, // it is all the same to renderData. chat.renderData(data, 'chatcompact', oldMsgsWereAdded); } @@ -350,7 +350,7 @@ window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel, is // format: timestamp, autogenerated, HTML message - storageHash.data[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team, msgToPlayer, systemNarrowcast)]; + storageHash.data[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team, msgToPlayer, systemNarrowcast), nick]; }); }