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/feed_manager.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index 58d6a005c..46a105124 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -33,22 +33,6 @@ class FeedManager
     redis.zremrangebyscore(key(type, account_id), '-inf', "(#{last.last}")
   end
 
-  private
-
-  def redis
-    $redis
-  end
-
-  # Filter status out of the home feed if it is a reply to someone the user doesn't follow
-  def filter_from_home?(status, receiver)
-    replied_to_user = status.reply? ? status.thread.account : nil
-    (status.reply? && !(receiver.id == replied_to_user.id || replied_to_user.id == status.account_id || receiver.following?(replied_to_user)))
-  end
-
-  def filter_from_mentions?(status, receiver)
-    receiver.blocking?(status.account) || (status.reblog? && receiver.blocking?(status.reblog.account))
-  end
-
   def inline_render(target_account, status)
     rabl_scope = Class.new do
       include RoutingHelper
@@ -58,7 +42,7 @@ class FeedManager
       end
 
       def current_user
-        @account.user
+        @account.try(:user)
       end
 
       def current_account
@@ -68,4 +52,20 @@ class FeedManager
 
     Rabl::Renderer.new('api/v1/statuses/show', status, view_path: 'app/views', format: :json, scope: rabl_scope.new(target_account)).render
   end
+
+  private
+
+  def redis
+    $redis
+  end
+
+  # Filter status out of the home feed if it is a reply to someone the user doesn't follow
+  def filter_from_home?(status, receiver)
+    replied_to_user = status.reply? ? status.thread.account : nil
+    (status.reply? && !(receiver.id == replied_to_user.id || replied_to_user.id == status.account_id || receiver.following?(replied_to_user))) || (status.reblog? && receiver.blocking?(status.reblog.account))
+  end
+
+  def filter_from_mentions?(status, receiver)
+    receiver.blocking?(status.account)
+  end
 end