2017-07-18 07:39:47 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-18 16:37:26 -07:00
|
|
|
class OStatus::Activity::Share < OStatus::Activity::Creation
|
2017-07-18 07:39:47 -07:00
|
|
|
def perform
|
|
|
|
return if reblog.nil?
|
|
|
|
|
|
|
|
status, just_created = super
|
|
|
|
NotifyService.new.call(reblog.account, status) if reblog.account.local? && just_created
|
|
|
|
status
|
|
|
|
end
|
|
|
|
|
|
|
|
def object
|
|
|
|
@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def reblog
|
|
|
|
return @reblog if defined? @reblog
|
|
|
|
|
2017-07-18 16:37:26 -07:00
|
|
|
original_status = OStatus::Activity::Remote.new(object).perform
|
2017-07-18 07:39:47 -07:00
|
|
|
return if original_status.nil?
|
|
|
|
|
|
|
|
@reblog = original_status.reblog? ? original_status.reblog : original_status
|
|
|
|
end
|
|
|
|
end
|