diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index a07c7b401..ca42c48bc 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -79,7 +79,8 @@ socket.on('speak', function(json) { document.getElementsByClassName('chat-line')[0].classList.add('diff') document.getElementsByClassName('userlink')[0].classList.remove('d-none') document.getElementsByClassName('avatar')[0].classList.remove('d-none') - document.getElementsByClassName('avatar')[0].src = json['avatar'] + document.getElementsByClassName('avatar-pic')[0].src = json['avatar'] + if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = json['hat'] document.getElementsByClassName('userlink')[0].href = '/@' + json['username'] document.getElementsByClassName('userlink')[0].style.color = '#' + json['namecolor'] document.getElementsByClassName('time')[0].classList.remove('d-none') diff --git a/files/templates/chat.html b/files/templates/chat.html index 3d9654381..6aa27aa44 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -139,7 +139,12 @@