about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-01-05 14:16:25 +0100
committerClaire <claire.github-309c@sitedethib.com>2023-01-05 14:16:25 +0100
commit6c20dad201efdfaec59c37ce3f3ca4c7702b5274 (patch)
treeb1df234db04b93b7d0c241d120019f03368850f4 /app/lib
parent7e9d5bdbb9125197afb5b3df69ce49a79451d697 (diff)
parent18d00055f4f7e28a9a4cc81d3159072e9beb779d (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream updated its README, while we have a completely different one.
  Kept our README.
- `app/controllers/concerns/web_app_controller_concern.rb`:
  Conflict because of glitch-soc's theming system.
  Additionally, glitch-soc has different behavior regarding moved accounts.
  Ported some of the changes, but kept our overall behavior.
- `app/javascript/packs/admin.js`:
  Code changes actually applied to `app/javascript/core/admin.js`
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/admin/system_check/elasticsearch_check.rb12
-rw-r--r--app/lib/feed_manager.rb3
2 files changed, 12 insertions, 3 deletions
diff --git a/app/lib/admin/system_check/elasticsearch_check.rb b/app/lib/admin/system_check/elasticsearch_check.rb
index a63988224..7f922978f 100644
--- a/app/lib/admin/system_check/elasticsearch_check.rb
+++ b/app/lib/admin/system_check/elasticsearch_check.rb
@@ -13,7 +13,14 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
 
   def message
     if running_version.present?
-      Admin::SystemCheck::Message.new(:elasticsearch_version_check, I18n.t('admin.system_checks.elasticsearch_version_check.version_comparison', running_version: running_version, required_version: required_version))
+      Admin::SystemCheck::Message.new(
+        :elasticsearch_version_check,
+        I18n.t(
+          'admin.system_checks.elasticsearch_version_check.version_comparison',
+          running_version: running_version,
+          required_version: required_version
+        )
+      )
     else
       Admin::SystemCheck::Message.new(:elasticsearch_running_check)
     end
@@ -23,7 +30,8 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
 
   def running_version
     @running_version ||= begin
-      Chewy.client.info['version']['number']
+      Chewy.client.info['version']['minimum_wire_compatibility_version'] ||
+        Chewy.client.info['version']['number']
     rescue Faraday::ConnectionFailed
       nil
     end
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index 9fe9ec346..14208e557 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -414,6 +414,7 @@ class FeedManager
     end
 
     return true if check_for_blocks.any? { |target_account_id| crutches[:blocking][target_account_id] || crutches[:muting][target_account_id] }
+    return true if crutches[:blocked_by][status.account_id]
 
     if status.reply? && !status.in_reply_to_account_id.nil?                                                                      # Filter out if it's a reply
       should_filter   = !crutches[:following][status.in_reply_to_account_id]                                                     # and I'm not following the person it's a reply to
@@ -606,7 +607,7 @@ class FeedManager
     crutches[:blocking]        = Block.where(account_id: receiver_id, target_account_id: check_for_blocks).pluck(:target_account_id).index_with(true)
     crutches[:muting]          = Mute.where(account_id: receiver_id, target_account_id: check_for_blocks).pluck(:target_account_id).index_with(true)
     crutches[:domain_blocking] = AccountDomainBlock.where(account_id: receiver_id, domain: statuses.flat_map { |s| [s.account.domain, s.reblog&.account&.domain] }.compact).pluck(:domain).index_with(true)
-    crutches[:blocked_by]      = Block.where(target_account_id: receiver_id, account_id: statuses.map { |s| s.reblog&.account_id }.compact).pluck(:account_id).index_with(true)
+    crutches[:blocked_by]      = Block.where(target_account_id: receiver_id, account_id: statuses.map { |s| [s.account_id, s.reblog&.account_id] }.flatten.compact).pluck(:account_id).index_with(true)
 
     crutches
   end