Use backend from glitch-soc for instance-only toots

This commit is contained in:
Renato "Lond" Cerqueira
2018-08-23 19:30:09 +02:00
parent ccc2f608c5
commit ffaa814bbe
11 changed files with 90 additions and 11 deletions

View File

@ -35,7 +35,7 @@ class AccountsController < ApplicationController
end
format.rss do
@statuses = cache_collection(default_statuses.without_reblogs.without_replies.limit(PAGE_SIZE), Status)
@statuses = cache_collection(default_statuses.without_local_only.without_reblogs.without_replies.limit(PAGE_SIZE), Status)
render xml: RSS::AccountSerializer.render(@account, @statuses)
end

View File

@ -19,7 +19,7 @@ class StreamEntriesController < ApplicationController
end
format.atom do
unless @stream_entry.hidden?
unless @stream_entry.hidden? || @stream_entry.local_only?
skip_session!
expires_in 3.minutes, public: true
end
@ -53,7 +53,7 @@ class StreamEntriesController < ApplicationController
@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