diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-12-15 20:25:25 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-12-15 20:25:25 +0100 |
commit | f3a4d57be14b40d1e3a6ad9e1a1f9337dafc872e (patch) | |
tree | 623c4b710fed94a7280587da7d66863ab489957c /app/lib | |
parent | 3868ba683d56dbbeecc839fdeaeb7b3d0b18bb9a (diff) | |
parent | f847f67410c75036edb2c4b45d0db048af0481c9 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `README.md`: Discarded upstream changes: we have our own README - `app/controllers/follower_accounts_controller.rb`: Port upstream's minor refactoring
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/admin/system_check/elasticsearch_check.rb | 1 | ||||
-rw-r--r-- | app/lib/request.rb | 3 | ||||
-rw-r--r-- | app/lib/status_reach_finder.rb | 2 | ||||
-rw-r--r-- | app/lib/translation_service/libre_translate.rb | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/app/lib/admin/system_check/elasticsearch_check.rb b/app/lib/admin/system_check/elasticsearch_check.rb index 8aee18267..a63988224 100644 --- a/app/lib/admin/system_check/elasticsearch_check.rb +++ b/app/lib/admin/system_check/elasticsearch_check.rb @@ -34,6 +34,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck end def compatible_version? + return false if running_version.nil? Gem::Version.new(running_version) >= Gem::Version.new(required_version) end end diff --git a/app/lib/request.rb b/app/lib/request.rb index 96d934a8f..b2819c8ed 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -30,7 +30,8 @@ class Request @verb = verb @url = Addressable::URI.parse(url).normalize @http_client = options.delete(:http_client) - @options = options.merge(socket_class: use_proxy? ? ProxySocket : Socket) + @allow_local = options.delete(:allow_local) + @options = options.merge(socket_class: use_proxy? || @allow_local ? ProxySocket : Socket) @options = @options.merge(proxy_url) if use_proxy? @headers = {} diff --git a/app/lib/status_reach_finder.rb b/app/lib/status_reach_finder.rb index ccf1e9e3a..36fb0e80f 100644 --- a/app/lib/status_reach_finder.rb +++ b/app/lib/status_reach_finder.rb @@ -70,7 +70,7 @@ class StatusReachFinder def followers_inboxes if @status.in_reply_to_local_account? && distributable? - @status.account.followers.or(@status.thread.account.followers).inboxes + @status.account.followers.or(@status.thread.account.followers.not_domain_blocked_by_account(@status.account)).inboxes elsif @status.direct_visibility? || @status.limited_visibility? [] else diff --git a/app/lib/translation_service/libre_translate.rb b/app/lib/translation_service/libre_translate.rb index 43576e306..4ebe21e45 100644 --- a/app/lib/translation_service/libre_translate.rb +++ b/app/lib/translation_service/libre_translate.rb @@ -27,7 +27,7 @@ class TranslationService::LibreTranslate < TranslationService def request(text, source_language, target_language) body = Oj.dump(q: text, source: source_language.presence || 'auto', target: target_language, format: 'html', api_key: @api_key) - req = Request.new(:post, "#{@base_url}/translate", body: body) + req = Request.new(:post, "#{@base_url}/translate", body: body, allow_local: true) req.add_headers('Content-Type': 'application/json') req end |