Add autofollow option to invites (#7805)
* Add autofollow option to invites * Trigger CodeClimate rebuild
This commit is contained in:
parent
33dd9bf36d
commit
ca85658975
12 changed files with 108 additions and 18 deletions
|
@ -2,13 +2,25 @@
|
|||
|
||||
class BootstrapTimelineService < BaseService
|
||||
def call(source_account)
|
||||
bootstrap_timeline_accounts.each do |target_account|
|
||||
FollowService.new.call(source_account, target_account)
|
||||
end
|
||||
@source_account = source_account
|
||||
|
||||
autofollow_inviter!
|
||||
autofollow_bootstrap_timeline_accounts!
|
||||
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 autofollow_bootstrap_timeline_accounts!
|
||||
bootstrap_timeline_accounts.each do |target_account|
|
||||
FollowService.new.call(@source_account, target_account)
|
||||
end
|
||||
end
|
||||
|
||||
def bootstrap_timeline_accounts
|
||||
return @bootstrap_timeline_accounts if defined?(@bootstrap_timeline_accounts)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue