Turn local-only threads into a one-way street, making it impossible to reply to a local-only post with a federated status (by accident)
parent
916d790794
commit
1550d43afd
|
@ -496,7 +496,7 @@ class Status < ApplicationRecord
|
|||
def set_local_only
|
||||
return unless account.domain.nil? && !attribute_changed?(:local_only)
|
||||
|
||||
self.local_only = marked_local_only?
|
||||
self.local_only = marked_local_only? || thread&.local_only
|
||||
end
|
||||
|
||||
def set_conversation
|
||||
|
|
|
@ -290,6 +290,23 @@ RSpec.describe Status do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'on a status in a local-only thread' do
|
||||
subject { described_class.new }
|
||||
|
||||
context 'when a status does not contain the local-only emoji' do
|
||||
let(:thread) { Fabricate(:Status, local_only: true) }
|
||||
|
||||
before do
|
||||
subject.thread = thread
|
||||
end
|
||||
|
||||
it 'is marked local-only' do
|
||||
subject.save!
|
||||
|
||||
expect(subject).to be_local_only
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#reported?' do
|
||||
|
|
Loading…
Reference in New Issue