2017-01-05 17:34:27 +01:00
|
|
|
var message_live_update = (function () {
|
|
|
|
|
|
|
|
var exports = {};
|
|
|
|
|
|
|
|
exports.update_stream_name = function (stream_id, new_name) {
|
2018-04-03 03:26:50 +02:00
|
|
|
_.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
|
|
|
|
if (list === undefined) {
|
|
|
|
return;
|
|
|
|
}
|
2017-01-05 17:34:27 +01:00
|
|
|
list.update_stream_name(stream_id, new_name);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2017-01-24 19:12:21 +01:00
|
|
|
exports.update_user_full_name = function (user_id, full_name) {
|
2018-04-03 03:26:50 +02:00
|
|
|
_.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
|
|
|
|
if (list === undefined) {
|
|
|
|
return;
|
|
|
|
}
|
2017-01-24 19:12:21 +01:00
|
|
|
list.update_user_full_name(user_id, full_name);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2017-02-23 00:31:34 +01:00
|
|
|
exports.update_avatar = function (user_id, avatar_url) {
|
|
|
|
var url = avatar_url;
|
2017-02-17 00:44:21 +01:00
|
|
|
url = people.format_small_avatar_url(url);
|
2017-01-21 21:45:52 +01:00
|
|
|
|
2018-04-03 03:26:50 +02:00
|
|
|
_.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
|
|
|
|
if (list === undefined) {
|
|
|
|
return;
|
|
|
|
}
|
2017-02-23 00:31:34 +01:00
|
|
|
list.update_user_avatar(user_id, url);
|
2017-01-21 21:45:52 +01:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2017-01-05 17:34:27 +01:00
|
|
|
return exports;
|
|
|
|
|
|
|
|
}());
|
|
|
|
if (typeof module !== 'undefined') {
|
|
|
|
module.exports = message_live_update;
|
|
|
|
}
|
|
|
|
|
2018-05-28 08:04:36 +02:00
|
|
|
window.message_live_update = message_live_update;
|