diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-06-15 18:00:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-15 18:00:23 +0200 |
commit | ca85658975dd6c85fbe5cc725698fe3a34d1234e (patch) | |
tree | 10a3d40ea8a1d74e8f4b2a8553d7cb11e23d588c /app/services/bootstrap_timeline_service.rb | |
parent | 33dd9bf36d7cb7c94f76520357879d1a913c4ccb (diff) |
Add autofollow option to invites (#7805)
* Add autofollow option to invites * Trigger CodeClimate rebuild
Diffstat (limited to 'app/services/bootstrap_timeline_service.rb')
-rw-r--r-- | app/services/bootstrap_timeline_service.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/services/bootstrap_timeline_service.rb b/app/services/bootstrap_timeline_service.rb index c01e25824..db2c83e5d 100644 --- a/app/services/bootstrap_timeline_service.rb +++ b/app/services/bootstrap_timeline_service.rb @@ -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) |