about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/entity_cache.rb2
-rw-r--r--app/lib/formatter.rb4
-rw-r--r--app/lib/inline_renderer.rb4
-rw-r--r--app/lib/sanitize_config.rb2
4 files changed, 8 insertions, 4 deletions
diff --git a/app/lib/entity_cache.rb b/app/lib/entity_cache.rb
index 8fff544a0..35a3773d2 100644
--- a/app/lib/entity_cache.rb
+++ b/app/lib/entity_cache.rb
@@ -8,7 +8,7 @@ class EntityCache
   MAX_EXPIRATION = 7.days.freeze
 
   def mention(username, domain)
-    Rails.cache.fetch(to_key(:mention, username, domain), expires_in: MAX_EXPIRATION) { Account.select(:username, :domain, :url).find_remote(username, domain) }
+    Rails.cache.fetch(to_key(:mention, username, domain), expires_in: MAX_EXPIRATION) { Account.select(:id, :username, :domain, :url).find_remote(username, domain) }
   end
 
   def emoji(shortcodes, domain)
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 36cdae9f7..f1a751f84 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -308,9 +308,9 @@ class Formatter
     end
 
     standard = Extractor.extract_entities_with_indices(text, options)
-    xmpp = Extractor.extract_xmpp_uris_with_indices(text, options)
+    extra = Extractor.extract_extra_uris_with_indices(text, options)
 
-    Extractor.remove_overlapping_entities(special + standard + xmpp)
+    Extractor.remove_overlapping_entities(special + standard + extra)
   end
 
   def html_friendly_extractor(html, options = {})
diff --git a/app/lib/inline_renderer.rb b/app/lib/inline_renderer.rb
index 761a8822d..27e334a4d 100644
--- a/app/lib/inline_renderer.rb
+++ b/app/lib/inline_renderer.rb
@@ -15,6 +15,10 @@ class InlineRenderer
       serializer = REST::NotificationSerializer
     when :conversation
       serializer = REST::ConversationSerializer
+    when :announcement
+      serializer = REST::AnnouncementSerializer
+    when :reaction
+      serializer = REST::ReactionSerializer
     else
       return
     end
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index 3554d34b9..2b5d554b5 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -2,7 +2,7 @@
 
 class Sanitize
   module Config
-    HTTP_PROTOCOLS ||= ['http', 'https', 'dat', 'dweb', 'ipfs', 'ipns', 'ssb', 'gopher', 'xmpp', :relative].freeze
+    HTTP_PROTOCOLS ||= ['http', 'https', 'dat', 'dweb', 'ipfs', 'ipns', 'ssb', 'gopher', 'xmpp', 'magnet', :relative].freeze
 
     CLASS_WHITELIST_TRANSFORMER = lambda do |env|
       node = env[:node]