diff options
author | ThibG <thib@sitedethib.com> | 2020-01-24 17:28:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-24 17:28:22 +0100 |
commit | 0be67df4f0a64367d9e376b06bd3fd2fb9ca8195 (patch) | |
tree | 2eaa85c899033aab9bd1b2f9da2d727ce5788e16 /app/lib | |
parent | a8c109baca4d02cc8aed454e231518c1f8ec1844 (diff) | |
parent | bdc1581556b86ba25a385c9309db714eeaba1ca1 (diff) |
Merge pull request #1265 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/entity_cache.rb | 2 | ||||
-rw-r--r-- | app/lib/formatter.rb | 4 | ||||
-rw-r--r-- | app/lib/inline_renderer.rb | 4 | ||||
-rw-r--r-- | app/lib/sanitize_config.rb | 2 |
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] |