diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/accounts_controller.rb | 22 | ||||
-rw-r--r-- | app/controllers/settings/preferences_controller.rb | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 3937e9e8a..f29be82c9 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -29,10 +29,10 @@ class AccountsController < ApplicationController return end - @pinned_statuses = cache_collection(pinned_statuses, Status) if show_pinned_statuses? @statuses = filtered_status_page(params) @statuses = cache_collection(@statuses, Status) + @rss_url = rss_url unless @statuses.empty? @older_url = older_url if @statuses.last.id > filtered_statuses.last.id @@ -40,6 +40,18 @@ class AccountsController < ApplicationController end end + format.rss do + expires_in 1.minute, public: true + + if current_account&.user&.allows_rss? + @statuses = filtered_statuses.without_reblogs.without_replies.limit(PAGE_SIZE) + @statuses = cache_collection(@statuses, Status) + else + @statuses = [] + end + render xml: RSS::AccountSerializer.render(@account, @statuses, params[:tag]) + end + format.json do expires_in 3.minutes, public: !(authorized_fetch_mode? && signed_request_account.present?) render json: @account, content_type: 'application/activity+json', serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter, fields: restrict_fields_to @@ -106,6 +118,14 @@ class AccountsController < ApplicationController params[:username] end + def rss_url + if tag_requested? + short_account_tag_url(@account, params[:tag], format: 'rss') + else + short_account_url(@account, format: 'rss') + end + end + def older_url pagination_url(max_id: @statuses.last.id) end diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index c91f40d26..e5a122de0 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -98,6 +98,7 @@ class Settings::PreferencesController < Settings::BaseController :setting_boost_interval_from, :setting_boost_interval_to, :setting_show_cursor, + :setting_allow_rss, :setting_default_privacy, :setting_default_sensitive, |