diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/post_status_service.rb | 1 | ||||
-rw-r--r-- | app/services/update_status_service.rb | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index eb60c1022..aef630f71 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -2,6 +2,7 @@ class PostStatusService < BaseService include Redisable + include ImgProxyHelper MIN_SCHEDULE_OFFSET = 5.minutes.freeze diff --git a/app/services/update_status_service.rb b/app/services/update_status_service.rb index 795e43d01..f59f26a25 100644 --- a/app/services/update_status_service.rb +++ b/app/services/update_status_service.rb @@ -2,6 +2,7 @@ class UpdateStatusService < BaseService include Redisable + include ImgProxyHelper ALLOWED_ATTRIBUTES = %i( spoiler_text @@ -42,11 +43,19 @@ class UpdateStatusService < BaseService @deleted_tag_ids = @status.tag_ids - @tags.pluck(:id) @deleted_tag_names = @status.tags.pluck(:name) - @tags.pluck(:name) @deleted_attachment_ids = @status.media_attachment_ids - (@params[:media_attachment_ids] || @params[:media_attachments]&.pluck(:id) || []) - @new_mention_ids = @mentions.pluck(:id) - @status.mention_ids + + @new_mention_ids = @mentions.pluck(:id) - @status.mention_ids ApplicationRecord.transaction do @status.update!(@params) - ProcessCommandTagsService.new.call(@account, @status) if @account.local? + + if @account.local? + ProcessCommandTagsService.new.call(@account, @status) + else + process_inline_images! + @status.save! + end + detach_deleted_tags attach_updated_tags end @@ -64,6 +73,7 @@ class UpdateStatusService < BaseService private def prune_attachments + @new_inline_ids = @status.inlined_attachments.pluck(:media_attachment_id) RemoveMediaAttachmentsWorker.perform_async(@deleted_attachment_ids) if @deleted_attachment_ids.present? end |