mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Move discourse-chat
to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
This commit is contained in:
33
plugins/chat/lib/chat_message_processor.rb
Normal file
33
plugins/chat/lib/chat_message_processor.rb
Normal file
@ -0,0 +1,33 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Chat::ChatMessageProcessor
|
||||
include ::CookedProcessorMixin
|
||||
|
||||
def initialize(chat_message)
|
||||
@model = chat_message
|
||||
@previous_cooked = (chat_message.cooked || "").dup
|
||||
@with_secure_uploads = false
|
||||
@size_cache = {}
|
||||
@opts = {}
|
||||
|
||||
cooked = ChatMessage.cook(chat_message.message)
|
||||
@doc = Loofah.fragment(cooked)
|
||||
end
|
||||
|
||||
def run!
|
||||
post_process_oneboxes
|
||||
DiscourseEvent.trigger(:chat_message_processed, @doc, @model)
|
||||
end
|
||||
|
||||
def large_images
|
||||
[]
|
||||
end
|
||||
|
||||
def broken_images
|
||||
[]
|
||||
end
|
||||
|
||||
def downloaded_images
|
||||
{}
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user