about summary refs log tree commit diff
path: root/app/presenters
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/account_relationships_presenter.rb18
-rw-r--r--app/presenters/instance_presenter.rb12
-rw-r--r--app/presenters/tag_relationships_presenter.rb12
3 files changed, 16 insertions, 26 deletions
diff --git a/app/presenters/account_relationships_presenter.rb b/app/presenters/account_relationships_presenter.rb
index ab8bac412..5d2b5435d 100644
--- a/app/presenters/account_relationships_presenter.rb
+++ b/app/presenters/account_relationships_presenter.rb
@@ -70,16 +70,16 @@ class AccountRelationshipsPresenter
   def cache_uncached!
     @uncached_account_ids.each do |account_id|
       maps_for_account = {
-        following:       { account_id => following[account_id] },
-        followed_by:     { account_id => followed_by[account_id] },
-        blocking:        { account_id => blocking[account_id] },
-        blocked_by:      { account_id => blocked_by[account_id] },
-        muting:          { account_id => muting[account_id] },
-        requested:       { account_id => requested[account_id] },
-        requested_by:    { account_id => requested_by[account_id] },
+        following: { account_id => following[account_id] },
+        followed_by: { account_id => followed_by[account_id] },
+        blocking: { account_id => blocking[account_id] },
+        blocked_by: { account_id => blocked_by[account_id] },
+        muting: { account_id => muting[account_id] },
+        requested: { account_id => requested[account_id] },
+        requested_by: { account_id => requested_by[account_id] },
         domain_blocking: { account_id => domain_blocking[account_id] },
-        endorsed:        { account_id => endorsed[account_id] },
-        account_note:    { account_id => account_note[account_id] },
+        endorsed: { account_id => endorsed[account_id] },
+        account_note: { account_id => account_note[account_id] },
       }
 
       Rails.cache.write("relationship:#{@current_account_id}:#{account_id}", maps_for_account, expires_in: 1.day)
diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb
index fba3cc734..25df4d85a 100644
--- a/app/presenters/instance_presenter.rb
+++ b/app/presenters/instance_presenter.rb
@@ -22,10 +22,6 @@ class InstancePresenter < ActiveModelSerializers::Model
     ContactPresenter.new
   end
 
-  def closed_registrations_message
-    Setting.closed_registrations_message
-  end
-
   def description
     Setting.site_short_description
   end
@@ -34,8 +30,8 @@ class InstancePresenter < ActiveModelSerializers::Model
     Setting.site_extended_description
   end
 
-  def privacy_policy
-    Setting.site_terms
+  def status_page_url
+    Setting.status_page_url
   end
 
   def domain
@@ -70,10 +66,6 @@ class InstancePresenter < ActiveModelSerializers::Model
     Rails.cache.fetch('distinct_domain_count') { Instance.count }
   end
 
-  def sample_accounts
-    Rails.cache.fetch('sample_accounts', expires_in: 12.hours) { Account.local.discoverable.popular.limit(3) }
-  end
-
   def version
     Mastodon::Version.to_s
   end
diff --git a/app/presenters/tag_relationships_presenter.rb b/app/presenters/tag_relationships_presenter.rb
index c3bdbaf07..52e24314b 100644
--- a/app/presenters/tag_relationships_presenter.rb
+++ b/app/presenters/tag_relationships_presenter.rb
@@ -4,12 +4,10 @@ class TagRelationshipsPresenter
   attr_reader :following_map
 
   def initialize(tags, current_account_id = nil, **options)
-    @following_map = begin
-      if current_account_id.nil?
-        {}
-      else
-        TagFollow.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).each_with_object({}) { |f, h| h[f.tag_id] = true }.merge(options[:following_map] || {})
-      end
-    end
+    @following_map = if current_account_id.nil?
+                       {}
+                     else
+                       TagFollow.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).each_with_object({}) { |f, h| h[f.tag_id] = true }.merge(options[:following_map] || {})
+                     end
   end
 end