@type = @stream_entry.activity_type.downcase
raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil?
- authorize @stream_entry.activity, :show? if @stream_entry.hidden?
+ authorize @stream_entry.activity, :show? if @stream_entry.hidden? || @stream_entry.local_only?
rescue Mastodon::NotPermittedError
# Reraise in order to get a 404
raise ActiveRecord::RecordNotFound
end
end
+ def local_only?
+ # match both with and without U+FE0F (the emoji variation selector)
+ /👁\ufe0f?\z/.match?(content)
+ end
+
private
def store_uri
scope :recent, -> { reorder(id: :desc) }
scope :with_includes, -> { includes(:account, status: STATUS_INCLUDES) }
- delegate :target, :title, :content, :thread,
+ delegate :target, :title, :content, :thread, :local_only?,
to: :status,
allow_nil: true
end
def show?
+ return false if local_only? && account.nil?
+
if direct?
owned? || status.mentions.where(account: account).exists?
elsif private?
def private?
status.private_visibility?
end
+
+ def local_only?
+ status.local_only?
+ end
end