Disable empty-stream PMs for MIT bots.

(imported from commit a855d612b6ba316fc183200c4f72102831b6179c)
This commit is contained in:
Steve Howell 2013-09-19 16:42:30 -04:00
parent 098720b6d1
commit 5ae5e3f881
1 changed files with 3 additions and 0 deletions

View File

@ -414,6 +414,9 @@ def check_stream_name(stream_name):
raise JsonableError("Invalid stream name") raise JsonableError("Invalid stream name")
def check_if_a_bot_is_sending_a_message_to_an_empty_stream(sender, stream, stream_name): def check_if_a_bot_is_sending_a_message_to_an_empty_stream(sender, stream, stream_name):
if sender.realm.domain == 'mit.edu':
return
if sender.is_bot and sender.bot_owner is not None: if sender.is_bot and sender.bot_owner is not None:
if stream: if stream:
num_subscribers = len(maybe_get_subscriber_emails(stream)) num_subscribers = len(maybe_get_subscriber_emails(stream))