mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: add outgoing web hooks for Chat messages
This commit is contained in:
13
plugins/chat/lib/chat/outgoing_web_hook_extension.rb
Normal file
13
plugins/chat/lib/chat/outgoing_web_hook_extension.rb
Normal file
@ -0,0 +1,13 @@
|
||||
# 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("chat_message").exists?
|
||||
WebHook.enqueue_hooks(:chat_message, event, payload: payload, **opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user