Merge pull request #1196 from johnholdun/hide-private-pinned-statuses

Hide follower-only pinned statuses from logged-out users
This commit is contained in:
Darius Kazemi 2022-11-11 15:58:37 -08:00 committed by GitHub
commit fe340a6a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class AccountsController < ApplicationController
end
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
@pinned_statuses = cache_collection(@account.pinned_statuses, Status) if show_pinned_statuses?
end

View File

@ -120,6 +120,11 @@ RSpec.describe AccountsController, type: :controller do
expect(response.body).to include(I18n.t('stream_entries.pinned'))
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
expect(response.body).to_not include(ActivityPub::TagManager.instance.url_for(status_private))
end