mirror of
https://github.com/discourse/discourse.git
synced 2025-03-13 07:15:33 +08:00

Before this change, webhooks could be only configured for specific groups like for example, all topic events. We would like to have more granular control like for example topic_created or topic_destroyed. Test are failing because plugins changed has to be merged as well: discourse/discourse-assign#498 discourse/discourse-solved#248 discourse/discourse-topic-voting#159
14 lines
338 B
Ruby
14 lines
338 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Chat
|
|
module OutgoingWebHookExtension
|
|
def self.prepended(base)
|
|
def base.enqueue_chat_message_hooks(event, payload, opts = {})
|
|
if active_web_hooks(event).exists?
|
|
WebHook.enqueue_hooks(:chat_message, event, payload: payload, **opts)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|