2017-07-18 17:39:47 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-19 02:37:26 +03:00
|
|
|
class OStatus::Activity::Share < OStatus::Activity::Creation
|
2017-07-18 17:39:47 +03: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-19 02:37:26 +03:00
|
|
|
original_status = OStatus::Activity::Remote.new(object).perform
|
2017-07-18 17:39:47 +03:00
|
|
|
return if original_status.nil?
|
|
|
|
|
|
|
|
@reblog = original_status.reblog? ? original_status.reblog : original_status
|
|
|
|
end
|
|
|
|
end
|