mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-24 19:22:41 +00:00
Merge commit from fork
* Refuse granting quote authorization for reblogs * Add validation to reject quotes of reblogs * Do not process quotes of reblogs as potentially valid quotes * Refuse to serve quoted reblogs over REST API
This commit is contained in:
parent
2b9e4294fe
commit
405a49df44
8 changed files with 146 additions and 5 deletions
|
|
@ -15,6 +15,22 @@ RSpec.describe Status::InteractionPolicyConcern do
|
|||
describe '#quote_policy_for_account' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
context 'when the account is the author' do
|
||||
let(:status) { Fabricate(:status, account: account, quote_approval_policy: 0) }
|
||||
|
||||
it 'returns :automatic' do
|
||||
expect(status.quote_policy_for_account(account)).to eq :automatic
|
||||
end
|
||||
|
||||
context 'when it is a reblog' do
|
||||
let(:status) { Fabricate(:status, account: account, quote_approval_policy: 0, reblog: Fabricate(:status)) }
|
||||
|
||||
it 'returns :automatic' do
|
||||
expect(status.quote_policy_for_account(account)).to eq :denied
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the account is not following the user' do
|
||||
it 'returns :manual because of the public entry in the manual policy' do
|
||||
expect(status.quote_policy_for_account(account)).to eq :manual
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue