mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 21:06:16 +00:00
Don't cache your personal gravatar across gravatar updates.
(imported from commit 06f82faaa350db8a64cebef24b738b5e93bebb98)
This commit is contained in:
@@ -42,7 +42,7 @@ var globals =
|
|||||||
// ui.js
|
// ui.js
|
||||||
+ ' register_onclick hide_email show_email'
|
+ ' register_onclick hide_email show_email'
|
||||||
+ ' report_error report_success report_message clicking mouse_moved'
|
+ ' report_error report_success report_message clicking mouse_moved'
|
||||||
+ ' userinfo_currently_popped update_gravatars'
|
+ ' userinfo_currently_popped update_gravatars gravatar_stamp'
|
||||||
+ ' register_user_info_mouseover register_user_info_mouseout'
|
+ ' register_user_info_mouseover register_user_info_mouseout'
|
||||||
|
|
||||||
// zephyr.js
|
// zephyr.js
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
<td class="message_picture">
|
<td class="message_picture">
|
||||||
{{#include_sender}}
|
{{#include_sender}}
|
||||||
<img class="img-rounded profile_picture user_info_hover"
|
<img class="img-rounded profile_picture user_info_hover"
|
||||||
src="https://secure.gravatar.com/avatar/{{gravatar_hash}}?d=identicon&s=30"
|
src="https://secure.gravatar.com/avatar/{{gravatar_hash}}?d=identicon&s=30?stamp={{stamp}}"
|
||||||
onclick="userinfo_popover(event, this, {{id}});"/>
|
onclick="userinfo_popover(event, this, {{id}});"/>
|
||||||
{{/include_sender}}
|
{{/include_sender}}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// scrollbar when we switch to a new tab (and restore it
|
// scrollbar when we switch to a new tab (and restore it
|
||||||
// when we switch back.)
|
// when we switch back.)
|
||||||
var scroll_positions = {};
|
var scroll_positions = {};
|
||||||
|
var gravatar_stamp = 1;
|
||||||
|
|
||||||
function register_onclick(message_row, message_id) {
|
function register_onclick(message_row, message_id) {
|
||||||
message_row.find(".messagebox").click(function (e) {
|
message_row.find(".messagebox").click(function (e) {
|
||||||
@@ -461,8 +462,9 @@ $(function () {
|
|||||||
|
|
||||||
function update_gravatars() {
|
function update_gravatars() {
|
||||||
$.each($(".gravatar-profile"), function(index, profile) {
|
$.each($(".gravatar-profile"), function(index, profile) {
|
||||||
$(this).attr('src', $(this).attr('src') + '?' + $.now());
|
$(this).attr('src', $(this).attr('src') + '?stamp=' + gravatar_stamp);
|
||||||
});
|
});
|
||||||
|
gravatar_stamp += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function poll_for_gravatar_update(start_time, url) {
|
function poll_for_gravatar_update(start_time, url) {
|
||||||
|
|||||||
@@ -325,6 +325,10 @@ function add_to_table(messages, table_name, filter_function, where) {
|
|||||||
|
|
||||||
message.dom_id = table_name + message.id;
|
message.dom_id = table_name + message.id;
|
||||||
|
|
||||||
|
if (message.sender_email === email) {
|
||||||
|
message.stamp = gravatar_stamp;
|
||||||
|
}
|
||||||
|
|
||||||
messages_to_render.push(message);
|
messages_to_render.push(message);
|
||||||
prev = message;
|
prev = message;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user