mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Outgoing Webhook System: Prevent infinite loops with outgoing webhooks.
This commit is contained in:
@@ -798,8 +798,14 @@ def do_send_messages(messages_maybe_none):
|
|||||||
ums.extend(ums_to_create)
|
ums.extend(ums_to_create)
|
||||||
|
|
||||||
# Now prepare the outgoing webhook events
|
# Now prepare the outgoing webhook events
|
||||||
|
|
||||||
message['message'].outgoing_webhook_bot_triggers = []
|
message['message'].outgoing_webhook_bot_triggers = []
|
||||||
|
|
||||||
|
# Avoid infinite loops by preventing messages sent by bots
|
||||||
|
# from triggering outgoing webhooks.
|
||||||
|
sender = message['message'].sender
|
||||||
|
if sender.is_bot:
|
||||||
|
continue
|
||||||
|
|
||||||
# TODO: Right now, outgoing webhook bots need to be a
|
# TODO: Right now, outgoing webhook bots need to be a
|
||||||
# subscribed to a stream in order to receive messages when
|
# subscribed to a stream in order to receive messages when
|
||||||
# mentioned; we will want to change that structure.
|
# mentioned; we will want to change that structure.
|
||||||
|
|||||||
Reference in New Issue
Block a user