diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-11-07 09:03:23 -0600 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-11-07 09:12:29 -0600 |
commit | ec3abd7c87116ad2df5b1da5701afe68a7f74844 (patch) | |
tree | 9b2d9e19c921ab31ba558e267753660ef55d2bcc /app/services | |
parent | 84369236449d181a7f78126c7951213091698414 (diff) |
Unpublish post if changed to local only during edit
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/update_status_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/update_status_service.rb b/app/services/update_status_service.rb index 9dc4fbbcd..cedd534ea 100644 --- a/app/services/update_status_service.rb +++ b/app/services/update_status_service.rb @@ -39,12 +39,12 @@ class UpdateStatusService < BaseService @params[:text] ||= '' @params[:original_text] = @params[:text] @params[:published] = true if @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? @params[:expires_at] ||= Time.now.utc + (@status.expires_at - @status.created_at) if @status.expires_at.present? @params[:originally_local_only] = @params[:local_only] unless @status.published? + RemoveStatusService.new.call(@status, unpublish: true) if @status.published? && !@status.local_only? && @params[:local_only] update_tags if @status.local? @delete_payload = Oj.dump(event: :delete, payload: @status.id.to_s) |