diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index f263eb5ac..58a459576 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -80,7 +80,7 @@ socket.on('speak', function(json) { document.getElementsByClassName('userlink')[0].classList.remove('d-none') document.getElementsByClassName('avatar')[0].classList.remove('d-none') document.getElementsByClassName('avatar-pic')[0].src = json['avatar'] - if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = `/i/hats/${json['hat']}?v=3` + if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = `/i/hats/${json['hat']}.webp?v=3` 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/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index b34b85526..c08cb7251 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -49,6 +49,7 @@ function popclick(e) { popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"] popover.getElementsByClassName('pop-picture')[0].src = author["profile_url"] + if (author["hat"]) popover.getElementsByClassName('pop-hat')[0].src = `/i/hats/${author['hat']}.webp?v=3` popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"] if (popover.getElementsByClassName('pop-bio').length > 0) { popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"] diff --git a/files/classes/user.py b/files/classes/user.py index 909a4e731..71a32ee79 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -693,6 +693,7 @@ class User(Base): 'url': self.url, 'id': self.id, 'profile_url': self.profile_url, + 'hat': self.hat_active.name, 'bannerurl': self.banner_url, 'bio_html': self.bio_html_eager, 'coins': self.coins, diff --git a/files/routes/chat.py b/files/routes/chat.py index 307b33eb3..fe810f507 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -66,7 +66,7 @@ def speak(data, v): data={ "avatar": v.profile_url, - "hat": v.hat_active, + "hat": v.hat_active.name, "username": v.username, "namecolor": v.namecolor, "text": text, diff --git a/files/templates/chat.html b/files/templates/chat.html index 47a2c33ba..15efbf817 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -222,6 +222,6 @@ - + \ No newline at end of file diff --git a/files/templates/hats.html b/files/templates/hats.html index 0465879bb..0dfda2157 100644 --- a/files/templates/hats.html +++ b/files/templates/hats.html @@ -22,7 +22,7 @@ const profile_pic_hat = document.getElementById("profile-pic-35-hat"); function extra_actions(xhr) { if(xhr.status == 200) { - profile_pic_hat.src = `/i/hats/${hat_name}.webp?v=1` + profile_pic_hat.src = `/i/hats/${hat_name}.webp?v=3` profile_pic_hat.classList.remove('d-none') } } diff --git a/files/templates/popover.html b/files/templates/popover.html index cb247cad4..08f3f5da2 100644 --- a/files/templates/popover.html +++ b/files/templates/popover.html @@ -4,7 +4,7 @@
- +
diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 8083efa52..e7ff991f3 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -18,7 +18,7 @@ set CACHE_VER = { 'js/award_modal.js': 4000, 'js/bootstrap.js': 4000, 'js/category_modal.js': 4000, - 'js/comments+submission_listing.js': 4000, + 'js/comments+submission_listing.js': 4001, 'js/comments_admin.js': 4000, 'js/comments_v.js': 4000, 'js/submission_listing.js': 4000,