2017-09-10 17:58:38 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class BootstrapTimelineService < BaseService
|
|
|
|
def call(source_account)
|
2018-06-16 02:00:23 +10:00
|
|
|
@source_account = source_account
|
|
|
|
|
|
|
|
autofollow_inviter!
|
2022-02-24 02:45:22 +11:00
|
|
|
notify_staff!
|
2017-09-10 17:58:38 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2018-06-16 02:00:23 +10:00
|
|
|
def autofollow_inviter!
|
|
|
|
return unless @source_account&.user&.invite&.autofollow?
|
2017-09-10 17:58:38 +10:00
|
|
|
|
2021-04-25 01:01:43 +10:00
|
|
|
FollowService.new.call(@source_account, @source_account.user.invite.user.account)
|
2017-09-10 17:58:38 +10:00
|
|
|
end
|
2022-02-24 02:45:22 +11:00
|
|
|
|
|
|
|
def notify_staff!
|
|
|
|
User.staff.includes(:account).find_each do |user|
|
2022-02-24 05:30:13 +11:00
|
|
|
NotifyService.new.call(user.account, :'admin.sign_up', @source_account)
|
2022-02-24 02:45:22 +11:00
|
|
|
end
|
|
|
|
end
|
2017-09-10 17:58:38 +10:00
|
|
|
end
|