From 5622de4a785e6b7c9a4946af3efaf8b4c2bc5755 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 23 Aug 2020 09:38:27 -0500 Subject: [Feature] Support Misskey-compatible boosts with attached content notes --- app/services/process_mentions_service.rb | 4 ++-- app/services/reblog_service.rb | 2 +- app/services/remove_status_service.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/services') diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index 2ec21f22b..ba61e4464 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -9,8 +9,8 @@ class ProcessMentionsService < BaseService # @param [Status] status # @option [Enumerable] :mentions Mentions to include # @option [Boolean] :deliver Deliver mention notifications - def call(status, mentions: [], reveal_implicit_mentions: true, deliver: true) - return unless status.local? + def call(status, mentions: [], deliver: true) + return unless status.local? && !status.frozen? @status = status @status.text, mentions = ResolveMentionsService.new.call(@status, mentions: mentions) diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb index f4280e9b2..ddd22e379 100644 --- a/app/services/reblog_service.rb +++ b/app/services/reblog_service.rb @@ -28,7 +28,7 @@ class ReblogService < BaseService end end - reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility, rate_limit: options[:with_rate_limit]) + reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility, rate_limit: options[:with_rate_limit], sensitive: true, spoiler_text: options[:spoiler_text] || '', published: true) DistributionWorker.perform_async(reblog.id) ActivityPub::DistributionWorker.perform_async(reblog.id) unless reblogged_status.local_only? diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb index 72ef6a9ec..f5983fc40 100644 --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@ -121,7 +121,7 @@ class RemoveStatusService < BaseService end def signed_activity_json - @signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account)) + @signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? && @status.spoiler_text.blank? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account)) end def remove_reblogs -- cgit