]> cat aescling's git repositories - mastodon.git/commitdiff
Do not display non-Status stream entries anymore
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 17 Feb 2017 01:20:52 +0000 (02:20 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 17 Feb 2017 01:20:52 +0000 (02:20 +0100)
app/controllers/stream_entries_controller.rb
app/models/stream_entry.rb

index da284d80ee0cde84cbaaaf310e0556f2a19c5398..c43d372ed364042436968921cd26903c8741161f 100644 (file)
@@ -43,7 +43,7 @@ class StreamEntriesController < ApplicationController
   end
 
   def set_stream_entry
-    @stream_entry = @account.stream_entries.find(params[:id])
+    @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))))
index 8b41c8c39f56ef15b70023f11ab2f4f40d3d79c8..ae7ae446e9be0a41ac0e66f9454901f8342b3d97 100644 (file)
@@ -55,7 +55,7 @@ class StreamEntry < ApplicationRecord
   end
 
   def activity
-    !new_record? ? send(activity_type.underscore) : super
+    !new_record? ? send(activity_type.underscore) || super : super
   end
 
   private