about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-05-23 22:04:23 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-23 15:04:23 +0200
commitea2ef16ea42d61b34653246a76ab2a5ba767ec15 (patch)
treebfe8dfd2aebae5804bac3f571312376d198b336b /app/controllers
parent1d3e0a50605d0f7eab93ec40c4b4b3de4654b4c5 (diff)
Cover StreamEntriesController more and remove redundant instructions (#3257)
* Cover StreamEntriesController more

* Remove redundant instructions in StreamEntriesController
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/stream_entries_controller.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb
index a9ee73500..baff4317a 100644
--- a/app/controllers/stream_entries_controller.rb
+++ b/app/controllers/stream_entries_controller.rb
@@ -11,12 +11,8 @@ class StreamEntriesController < ApplicationController
   def show
     respond_to do |format|
       format.html do
-        return gone if @stream_entry.activity.nil?
-
-        if @stream_entry.activity_type == 'Status'
-          @ancestors   = @stream_entry.activity.reply? ? cache_collection(@stream_entry.activity.ancestors(current_account), Status) : []
-          @descendants = cache_collection(@stream_entry.activity.descendants(current_account), Status)
-        end
+        @ancestors   = @stream_entry.activity.reply? ? cache_collection(@stream_entry.activity.ancestors(current_account), Status) : []
+        @descendants = cache_collection(@stream_entry.activity.descendants(current_account), Status)
       end
 
       format.atom do
@@ -46,7 +42,7 @@ class StreamEntriesController < ApplicationController
     @stream_entry = @account.stream_entries.where(activity_type: 'Status').find(params[:id])
     @type         = @stream_entry.activity_type.downcase
 
-    raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil? || (@stream_entry.hidden? && (@stream_entry.activity_type != 'Status' || (@stream_entry.activity_type == 'Status' && !@stream_entry.activity.permitted?(current_account))))
+    raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil? || (@stream_entry.hidden? && !@stream_entry.activity.permitted?(current_account))
   end
 
   def check_account_suspension