2
0

Change public self-quotes of private posts to be disallowed (#35975)

This commit is contained in:
Claire
2025-09-02 17:48:37 +02:00
committed by GitHub
parent 5d9a9c76fb
commit 75fca715e9
7 changed files with 70 additions and 24 deletions

View File

@@ -88,10 +88,10 @@ RSpec.describe StatusPolicy, type: :model do
context 'with the permission of quote?' do
permissions :quote? do
it 'grants access when direct and account is viewer' do
it 'does not grant access when direct and account is viewer' do
status.visibility = :direct
expect(subject).to permit(status.account, status)
expect(subject).to_not permit(status.account, status)
end
it 'does not grant access access when direct and viewer is mentioned but not explicitly allowed' do

View File

@@ -305,6 +305,14 @@ RSpec.describe PostStatusService do
.to enqueue_sidekiq_job(ActivityPub::QuoteRequestWorker)
end
it 'correctly downgrades visibility for private self-quotes' do
account = Fabricate(:account)
quoted_status = Fabricate(:status, account: account, visibility: :private)
status = subject.call(account, text: 'test', quoted_status: quoted_status)
expect(status).to be_private_visibility
end
it 'returns existing status when used twice with idempotency key' do
account = Fabricate(:account)
status1 = subject.call(account, text: 'test', idempotency: 'meepmeep')