mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-10 00:46:12 +00:00
25 lines
553 B
Ruby
25 lines
553 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BootstrapTimelineService < BaseService
|
|
def call(source_account)
|
|
@source_account = source_account
|
|
|
|
autofollow_inviter!
|
|
notify_staff!
|
|
end
|
|
|
|
private
|
|
|
|
def autofollow_inviter!
|
|
return unless @source_account&.user&.invite&.autofollow?
|
|
|
|
FollowService.new.call(@source_account, @source_account.user.invite.user.account)
|
|
end
|
|
|
|
def notify_staff!
|
|
User.staff.includes(:account).find_each do |user|
|
|
NotifyService.new.call(user.account, :'admin.new_user', @source_account)
|
|
end
|
|
end
|
|
end
|