mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
We use to have client-side logic that would append timestamps or random numbers to avatar URLs to force browsers to refresh their cache. We no longer need this now that the back end maintains versions for avatar changes and puts the version in the URLs.
33 lines
832 B
JavaScript
33 lines
832 B
JavaScript
var message_live_update = (function () {
|
|
|
|
var exports = {};
|
|
|
|
exports.update_stream_name = function (stream_id, new_name) {
|
|
_.each([home_msg_list, current_msg_list, message_list.all], function (list) {
|
|
list.update_stream_name(stream_id, new_name);
|
|
});
|
|
};
|
|
|
|
exports.update_user_full_name = function (user_id, full_name) {
|
|
_.each([home_msg_list, current_msg_list, message_list.all], function (list) {
|
|
list.update_user_full_name(user_id, full_name);
|
|
});
|
|
};
|
|
|
|
exports.update_avatar = function (person) {
|
|
var url = person.avatar_url;
|
|
url = people.format_small_avatar_url(url);
|
|
|
|
$(".inline_profile_picture.u-" + person.user_id).css({
|
|
"background-image": "url(" + url + ")",
|
|
});
|
|
};
|
|
|
|
return exports;
|
|
|
|
}());
|
|
if (typeof module !== 'undefined') {
|
|
module.exports = message_live_update;
|
|
}
|
|
|