about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-06-16 15:08:52 +0200
committerGitHub <noreply@github.com>2018-06-16 15:08:52 +0200
commitc08a2495589183f39cf44ac4c9b71f81dd9dacdc (patch)
tree15f4291e3d955f17489f3c43ab711dc536c32bb8 /app/services
parente8ccac468af9530b4f4d38598859efdb2eb48976 (diff)
parentdb200226b805db324a8efdfb951d7725eac3f9da (diff)
Merge pull request #544 from ThibG/glitch-soc/merge-upstream
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services')
-rw-r--r--app/services/bootstrap_timeline_service.rb18
-rw-r--r--app/services/post_status_service.rb1
2 files changed, 15 insertions, 4 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)
 
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 6e982c7e6..843659eaa 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -22,7 +22,6 @@ class PostStatusService < BaseService
     media  = validate_media!(options[:media_ids])
     status = nil
     text   = options.delete(:spoiler_text) if text.blank? && options[:spoiler_text].present?
-    text   = '.' if text.blank? && media.present?
 
     ApplicationRecord.transaction do
       status = account.statuses.create!(text: text,