mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
embedded bots: Dispatch all config data on update event.
Previously, when a user updated the config data of an embedded bot, only the updated fields were dispatched back to the client. Dispatching all config data fields makes the client updating code less brittle.
This commit is contained in:
@@ -4443,11 +4443,12 @@ def do_update_bot_config_data(bot_profile: UserProfile,
|
|||||||
config_data: Dict[Text, Text]) -> None:
|
config_data: Dict[Text, Text]) -> None:
|
||||||
for key, value in config_data.items():
|
for key, value in config_data.items():
|
||||||
set_bot_config(bot_profile, key, value)
|
set_bot_config(bot_profile, key, value)
|
||||||
|
updated_config_data = get_bot_config(bot_profile)
|
||||||
send_event(dict(type='realm_bot',
|
send_event(dict(type='realm_bot',
|
||||||
op='update',
|
op='update',
|
||||||
bot=dict(email=bot_profile.email,
|
bot=dict(email=bot_profile.email,
|
||||||
user_id=bot_profile.id,
|
user_id=bot_profile.id,
|
||||||
services = [dict(config_data=config_data)],
|
services = [dict(config_data=updated_config_data)],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bot_owner_user_ids(bot_profile))
|
bot_owner_user_ids(bot_profile))
|
||||||
|
|||||||
Reference in New Issue
Block a user