Hide follower-only pinned statuses from logged-out users

Fixes #1178
This commit is contained in:
John Holdun 2022-11-09 18:51:46 -08:00
parent 69ff67746b
commit 7eedaeb007
2 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class AccountsController < ApplicationController
end end
if current_user.nil? if current_user.nil?
@pinned_statuses = cache_collection(@account.pinned_statuses.without_local_only, Status) if show_pinned_statuses? @pinned_statuses = cache_collection(filtered_pinned_statuses.without_local_only, Status) if show_pinned_statuses?
else else
@pinned_statuses = cache_collection(@account.pinned_statuses, Status) if show_pinned_statuses? @pinned_statuses = cache_collection(@account.pinned_statuses, Status) if show_pinned_statuses?
end end

View File

@ -120,6 +120,11 @@ RSpec.describe AccountsController, type: :controller do
expect(response.body).to include(I18n.t('stream_entries.pinned')) expect(response.body).to include(I18n.t('stream_entries.pinned'))
end end
it 'does not render private pinned status' do
account.pinned_statuses << status_private
expect(response.body).to_not include(ActivityPub::TagManager.instance.url_for(status_private))
end
it 'does not render private status' do it 'does not render private status' do
expect(response.body).to_not include(ActivityPub::TagManager.instance.url_for(status_private)) expect(response.body).to_not include(ActivityPub::TagManager.instance.url_for(status_private))
end end