Progress on DMs responsiveness
Progress on DMs responsiveness
This commit is contained in:
@@ -11,7 +11,7 @@ class EntityCache
|
||||
Rails.cache.fetch(to_key(:mention, username, domain), expires_in: MAX_EXPIRATION) { Account.select(:username, :domain, :url).find_local(username) }
|
||||
end
|
||||
|
||||
def emoji(shortcodes, domain)
|
||||
def emoji(shortcodes, domain = nil)
|
||||
shortcodes = [shortcodes] unless shortcodes.is_a?(Array)
|
||||
cached = Rails.cache.read_multi(*shortcodes.map { |shortcode| to_key(:emoji, shortcode, domain) })
|
||||
uncached_ids = []
|
||||
|
||||
@@ -80,6 +80,21 @@ class Formatter
|
||||
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
def chatMessageText(chatMessage)
|
||||
raw_content = chatMessage.text
|
||||
|
||||
return '' if raw_content.blank?
|
||||
|
||||
html = raw_content
|
||||
html = encode_and_link_urls(html, nil, keep_html: false)
|
||||
html = reformat(html, true)
|
||||
html = encode_custom_emojis(html, chatMessage.emojis)
|
||||
|
||||
html.html_safe # rubocop:disable Rails/OutputSafety
|
||||
|
||||
html
|
||||
end
|
||||
|
||||
def format(status, **options)
|
||||
if options[:use_markdown]
|
||||
raw_content = status.markdown
|
||||
|
||||
Reference in New Issue
Block a user