Add events for bot default_events_register_stream changes

(imported from commit 143ed5b110a7f3b37f145dcd3fbe9133a183c7ec)
This commit is contained in:
Jason Michalski
2014-02-26 15:34:12 -05:00
parent f66d864f45
commit 0165da405f
2 changed files with 18 additions and 0 deletions

View File

@@ -1395,6 +1395,16 @@ def do_change_default_events_register_stream(user_profile, stream, log=True):
log_event({'type': 'user_change_default_events_register_stream',
'user': user_profile.email,
'stream': str(stream)})
if user_profile.is_bot:
if stream:
stream_name = stream.name
else:
stream_name = None
send_event(dict(type='realm_bot',
op='update',
bot=dict(email=user_profile.email,
default_events_register_stream=stream_name,)),
bot_owner_userids(user_profile))
def do_change_default_all_public_streams(user_profile, value, log=True):
user_profile.default_all_public_streams = value