mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
subscription: Fix unexpected blueslip warnings on add subscriber.
In stream settings, if user add subscriber to unsubscribed public stream from `Add` input widget it gives lots of blueslip warnings, cause user isn't subscribed to public stream. Fix this by changing condition to `sub.can_access_subscriber` from `sub.subscribed` in blueslip warning, cause user can access subscribers in such cases even if not subscribed to stream. Tweaked by tabbott to make the node tests pass.
This commit is contained in:
@@ -363,11 +363,10 @@ exports.remove_subscriber = function (stream_name, user_id) {
|
||||
|
||||
exports.user_is_subscribed = function (stream_name, user_email) {
|
||||
var sub = exports.get_sub(stream_name);
|
||||
if (typeof sub === 'undefined' || !sub.subscribed) {
|
||||
// If we don't know about the stream, or we ourselves are not
|
||||
// subscribed, we can't keep track of the subscriber list in general,
|
||||
if (typeof sub === 'undefined' || !sub.can_access_subscribers) {
|
||||
// If we don't know about the stream, or we ourselves can not access subscriber list,
|
||||
// so we return undefined (treated as falsy if not explicitly handled).
|
||||
blueslip.warn("We got a user_is_subscribed call for a non-existent or unsubscribed stream.");
|
||||
blueslip.warn("We got a user_is_subscribed call for a non-existent or inaccessible stream.");
|
||||
return;
|
||||
}
|
||||
var user_id = people.get_user_id(user_email);
|
||||
|
||||
Reference in New Issue
Block a user