parent
a772f7258f
commit
d0f0dd723c
2 changed files with 13 additions and 4 deletions
|
@ -631,12 +631,10 @@ class Status < ApplicationRecord
|
||||||
|
|
||||||
self.searchability = if %w(public public_unlisted login unlisted).include?(visibility)
|
self.searchability = if %w(public public_unlisted login unlisted).include?(visibility)
|
||||||
searchability
|
searchability
|
||||||
elsif visibility == 'limited'
|
elsif visibility == 'limited' || visibility == 'direct'
|
||||||
:limited
|
searchability == 'limited' ? :limited : :direct
|
||||||
elsif visibility == 'private'
|
elsif visibility == 'private'
|
||||||
searchability == 'public' || searchability == 'public_unlisted' ? :private : searchability
|
searchability == 'public' || searchability == 'public_unlisted' ? :private : searchability
|
||||||
elsif visibility == 'direct'
|
|
||||||
searchability == 'limited' ? :limited : :direct
|
|
||||||
else
|
else
|
||||||
:direct
|
:direct
|
||||||
end
|
end
|
||||||
|
|
|
@ -209,6 +209,17 @@ RSpec.describe PostStatusService, type: :service do
|
||||||
expect(status.mentioned_accounts.first.id).to eq mutual_account.id
|
expect(status.mentioned_accounts.first.id).to eq mutual_account.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'limited visibility and direct searchability' do
|
||||||
|
account = Fabricate(:account)
|
||||||
|
text = 'This is an English text.'
|
||||||
|
|
||||||
|
status = subject.call(account, text: text, visibility: 'mutual', searchability: 'public')
|
||||||
|
|
||||||
|
expect(status.visibility).to eq 'limited'
|
||||||
|
expect(status.limited_scope).to eq 'personal'
|
||||||
|
expect(status.searchability).to eq 'direct'
|
||||||
|
end
|
||||||
|
|
||||||
it 'personal visibility with mutual' do
|
it 'personal visibility with mutual' do
|
||||||
account = Fabricate(:account)
|
account = Fabricate(:account)
|
||||||
text = 'This is an English text.'
|
text = 'This is an English text.'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue