|
|
@ -61,12 +61,25 @@ class ProcessFeedService < BaseService
|
|
|
|
|
|
|
|
|
|
|
|
status.save!
|
|
|
|
status.save!
|
|
|
|
|
|
|
|
|
|
|
|
NotifyService.new.call(status.reblog.account, status) if status.reblog? && status.reblog.account.local?
|
|
|
|
notify_about_mentions!(status) unless status.reblog?
|
|
|
|
|
|
|
|
notify_about_reblog!(status) if status.reblog? && status.reblog.account.local?
|
|
|
|
Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution"
|
|
|
|
Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution"
|
|
|
|
DistributionWorker.perform_async(status.id)
|
|
|
|
DistributionWorker.perform_async(status.id)
|
|
|
|
status
|
|
|
|
status
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def notify_about_mentions!(status)
|
|
|
|
|
|
|
|
status.mentions.includes(:account).each do |mention|
|
|
|
|
|
|
|
|
mentioned_account = mention.account
|
|
|
|
|
|
|
|
next unless mentioned_account.local?
|
|
|
|
|
|
|
|
NotifyService.new.call(mentioned_account, mention)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def notify_about_reblog!(status)
|
|
|
|
|
|
|
|
NotifyService.new.call(status.reblog.account, status)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def delete_status
|
|
|
|
def delete_status
|
|
|
|
Rails.logger.debug "Deleting remote status #{id}"
|
|
|
|
Rails.logger.debug "Deleting remote status #{id}"
|
|
|
|
status = Status.find_by(uri: id)
|
|
|
|
status = Status.find_by(uri: id)
|
|
|
@ -159,10 +172,7 @@ class ProcessFeedService < BaseService
|
|
|
|
|
|
|
|
|
|
|
|
next if mentioned_account.nil? || processed_account_ids.include?(mentioned_account.id)
|
|
|
|
next if mentioned_account.nil? || processed_account_ids.include?(mentioned_account.id)
|
|
|
|
|
|
|
|
|
|
|
|
mention = mentioned_account.mentions.where(status: parent).first_or_create(status: parent)
|
|
|
|
mentioned_account.mentions.where(status: parent).first_or_create(status: parent)
|
|
|
|
|
|
|
|
|
|
|
|
# Notify local user
|
|
|
|
|
|
|
|
NotifyService.new.call(mentioned_account, mention) if mentioned_account.local?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# So we can skip duplicate mentions
|
|
|
|
# So we can skip duplicate mentions
|
|
|
|
processed_account_ids << mentioned_account.id
|
|
|
|
processed_account_ids << mentioned_account.id
|
|
|
|