mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
stream_data: Modify is_user_subscribed to use stream id.
This commit changes stream_data.is_user_subscribed to use stream id instead of stream name. We are using stream ids so that we can avoid bugs related to live update after stream rename.
This commit is contained in:
@@ -683,8 +683,8 @@ exports.remove_subscriber = function (stream_id, user_id) {
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.is_user_subscribed = function (stream_name, user_id) {
|
||||
const sub = exports.get_sub(stream_name);
|
||||
exports.is_user_subscribed = function (stream_id, user_id) {
|
||||
const sub = exports.get_sub_by_id(stream_id);
|
||||
if (typeof sub === 'undefined' || !sub.can_access_subscribers) {
|
||||
// If we don't know about the stream, or we ourselves cannot access subscriber list,
|
||||
// so we return undefined (treated as falsy if not explicitly handled).
|
||||
|
||||
Reference in New Issue
Block a user