From 652cd433896930247b79eee3c57954f8d77a8e2f Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Fri, 14 Aug 2020 12:49:14 -0500 Subject: [Privacy] Allow setting local-only flag on edits if original was unpublished --- app/services/update_status_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/services/update_status_service.rb b/app/services/update_status_service.rb index 327cc74ea..015010588 100644 --- a/app/services/update_status_service.rb +++ b/app/services/update_status_service.rb @@ -13,6 +13,7 @@ class UpdateStatusService < BaseService language sensitive visibility + local_only media_attachments media_attachment_ids application @@ -36,7 +37,8 @@ class UpdateStatusService < BaseService @params[:text] ||= '' @params[:original_text] = @params[:text] @params[:published] = true if @status.published? - (@params[:edited] ||= 1 + @status.edited) if @params[:published].presence || @status.published? + @params[:local_only] = @status.local_only? if @params[:local_only] == true && (@status.edited.positive? || @status.published?) + @params[:edited] ||= 1 + @status.edited if @params[:published].presence || @status.published? update_tags if @status.local? -- cgit