Gab-Social/app/services/fan_out_on_write_service.rb

20 lines
472 B
Ruby
Raw Normal View History

2019-07-02 07:10:25 +00:00
# frozen_string_literal: true
class FanOutOnWriteService < BaseService
2020-07-02 01:40:00 +00:00
2019-07-02 07:10:25 +00:00
# Push a status into home and mentions feeds
# @param [Status] status
2020-11-15 18:48:32 +00:00
def call(status)
2019-07-02 07:10:25 +00:00
raise GabSocial::RaceConditionError if status.visibility.nil?
2020-12-16 00:31:30 +00:00
deliver_to_self(status) if status.account.local?
2019-07-02 07:10:25 +00:00
end
private
def deliver_to_self(status)
Rails.logger.debug "Delivering status #{status.id} to author"
FeedManager.instance.push_to_home(status.account, status)
end
end