mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
subscription: Add real time sync for user-just-deactivated case.
Currently, stream subscriptions aren't getting updated without hard reload when user is deactivated in realm. Fix this issue by updating stream subscription widgets on user deactivation event. Fixes #5623
This commit is contained in:
@@ -349,6 +349,16 @@ exports.add_subscriber = function (stream_name, user_id) {
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.remove_deactivated_user_from_all_streams = function (user_id) {
|
||||
(stream_info.values()).forEach(function (stream) {
|
||||
if (exports.is_user_subscribed(stream.name, user_id)) {
|
||||
exports.remove_subscriber(stream.name, user_id);
|
||||
var sub = exports.get_sub(stream.name);
|
||||
subs.rerender_subscriptions_settings(sub);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.remove_subscriber = function (stream_name, user_id) {
|
||||
var sub = exports.get_sub(stream_name);
|
||||
if (typeof sub === 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user