diff --git a/app/models/status.rb b/app/models/status.rb index 2825ade5247786..13cfc6d3181d7d 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -496,7 +496,7 @@ def set_visibility 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 diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb index cd0d32b56ba096..1ee5e199df286c 100644 --- a/spec/models/status_spec.rb +++ b/spec/models/status_spec.rb @@ -290,6 +290,23 @@ 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