2017-07-19 00:39:47 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-19 09:37:26 +10:00
|
|
|
class OStatus::Activity::Share < OStatus::Activity::Creation
|
2017-07-19 00:39:47 +10: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
|
2017-09-20 02:08:08 +10:00
|
|
|
@xml.at_xpath('.//activity:object', activity: OStatus::TagManager::AS_XMLNS)
|
2017-07-19 00:39:47 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def reblog
|
|
|
|
return @reblog if defined? @reblog
|
|
|
|
|
2017-07-19 09:37:26 +10:00
|
|
|
original_status = OStatus::Activity::Remote.new(object).perform
|
2017-07-19 00:39:47 +10:00
|
|
|
return if original_status.nil?
|
|
|
|
|
|
|
|
@reblog = original_status.reblog? ? original_status.reblog : original_status
|
|
|
|
end
|
|
|
|
end
|