mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Fix @-mention "not subscribed" warning for all_public_streams bots.
Don't warn when @-mentioning a bot on a public stream that it does not appear to be subscribed to. It may be receiving those messages anyway. (imported from commit 4a00694942a721897a01736f48033c71048e0b16)
This commit is contained in:
@@ -84,6 +84,13 @@ exports.would_receive_message = function (email) {
|
||||
}
|
||||
|
||||
if (focused_recipient.type === 'stream') {
|
||||
var user = realm_people_dict.get(email);
|
||||
var sub = stream_data.get_sub(focused_recipient.stream);
|
||||
if (user && sub && user.is_bot && !sub.invite_only) {
|
||||
// Bots may receive messages on public streams even if they are
|
||||
// not subscribed.
|
||||
return undefined;
|
||||
}
|
||||
return stream_data.user_is_subscribed(focused_recipient.stream, email);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user