diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-06-15 20:51:39 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-06-15 20:51:39 +0200 |
commit | db200226b805db324a8efdfb951d7725eac3f9da (patch) | |
tree | a7d8298fc65bbd81e2f843048240de6e4fceffcf /app/services/bootstrap_timeline_service.rb | |
parent | afceef74c2377192f100b9307068895ec0ec7d45 (diff) | |
parent | 0df91c7b1e05952ebbfc552915e995d55af0a403 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: app/javascript/mastodon/initial_state.js db/schema.rb Upstream added a new field to initial_state. Not too sure about what happened with db/schema.rb though…
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) |