Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master

This commit is contained in:
Jenkins
2017-11-30 03:17:12 +00:00
13 changed files with 139 additions and 43 deletions

View File

@@ -42,7 +42,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService
end
def expected_type?
%w(Note Article).include? @json['type']
(ActivityPub::Activity::Create::SUPPORTED_TYPES + ActivityPub::Activity::Create::CONVERTED_TYPES).include? @json['type']
end
def needs_update(actor)

View File

@@ -107,12 +107,7 @@ class ActivityPub::ProcessAccountService < BaseService
def url
return if @json['url'].blank?
value = first_of_value(@json['url'])
return value if value.is_a?(String)
value['href']
url_to_href(@json['url'], 'text/html')
end
def outbox_total_items

View File

@@ -3,7 +3,7 @@
class RemoveStatusService < BaseService
include StreamEntryRenderer
def call(status)
def call(status, options = {})
@payload = Oj.dump(event: :delete, payload: status.id.to_s)
@status = status
@account = status.account
@@ -11,6 +11,7 @@ class RemoveStatusService < BaseService
@mentions = status.mentions.includes(:account).to_a
@reblogs = status.reblogs.to_a
@stream_entry = status.stream_entry
@options = options
remove_from_self if status.account.local?
remove_from_followers
@@ -23,7 +24,12 @@ class RemoveStatusService < BaseService
@status.destroy!
return unless @account.local?
# There is no reason to send out Undo activities when the
# cause is that the original object has been removed, since
# original object being removed implicitly removes reblogs
# of it. The Delete activity of the original is forwarded
# separately.
return if !@account.local? || @options[:original_removed]
remove_from_remote_followers
remove_from_remote_affected
@@ -105,7 +111,7 @@ class RemoveStatusService < BaseService
# without us being able to do all the fancy stuff
@reblogs.each do |reblog|
RemoveStatusService.new.call(reblog)
RemoveStatusService.new.call(reblog, original_removed: true)
end
end