events: Only send bot_type for bots and thus remove the for_api param.

This commit is contained in:
Hemanth V. Alluri
2019-10-26 22:02:21 +05:30
committed by Tim Abbott
parent fa6bd42f4c
commit c1370547d5
4 changed files with 7 additions and 12 deletions

View File

@@ -447,8 +447,10 @@ def notify_created_user(user_profile: UserProfile) -> None:
date_joined=user_profile.date_joined.isoformat(),
is_guest=user_profile.is_guest,
is_bot=user_profile.is_bot) # type: Dict[str, Any]
if user_profile.is_bot and user_profile.bot_owner_id is not None:
person["bot_owner_id"] = user_profile.bot_owner_id
if user_profile.is_bot:
person["bot_type"] = user_profile.bot_type
if user_profile.bot_owner_id is not None:
person["bot_owner_id"] = user_profile.bot_owner_id
event = dict(type="realm_user", op="add", person=person) # type: Dict[str, Any]
if not user_profile.is_bot:
event["person"]["profile_data"] = {}