Don't cache your personal gravatar across gravatar updates.

(imported from commit 06f82faaa350db8a64cebef24b738b5e93bebb98)
This commit is contained in:
Jessica McKellar 2012-11-06 17:06:47 -05:00
parent 85423bc010
commit 3af5e246be
4 changed files with 9 additions and 3 deletions

View File

@ -42,7 +42,7 @@ var globals =
// ui.js
+ ' register_onclick hide_email show_email'
+ ' 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'
// zephyr.js

View File

@ -50,7 +50,7 @@
<td class="message_picture">
{{#include_sender}}
<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}});"/>
{{/include_sender}}
</td>

View File

@ -3,6 +3,7 @@
// scrollbar when we switch to a new tab (and restore it
// when we switch back.)
var scroll_positions = {};
var gravatar_stamp = 1;
function register_onclick(message_row, message_id) {
message_row.find(".messagebox").click(function (e) {
@ -461,8 +462,9 @@ $(function () {
function update_gravatars() {
$.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) {

View File

@ -325,6 +325,10 @@ function add_to_table(messages, table_name, filter_function, where) {
message.dom_id = table_name + message.id;
if (message.sender_email === email) {
message.stamp = gravatar_stamp;
}
messages_to_render.push(message);
prev = message;
});