about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-26 21:15:19 +0100
committerGitHub <noreply@github.com>2022-02-26 21:15:19 +0100
commit551820cbd9e5beebd16f16205143e2263d4f2d51 (patch)
tree6868722efeb660c0031a22aecfdc4b2c5bc9dcc6 /app/services
parente48eaf64cc7cb0cfab388331c4823ee5fb580d59 (diff)
parent67c6f37e269a4ebb538e019351f894183f3c1439 (diff)
Merge pull request #1704 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services')
-rw-r--r--app/services/delete_account_service.rb32
-rw-r--r--app/services/favourite_service.rb2
-rw-r--r--app/services/reblog_service.rb3
3 files changed, 20 insertions, 17 deletions
diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb
index a572a7c59..a2d535d26 100644
--- a/app/services/delete_account_service.rb
+++ b/app/services/delete_account_service.rb
@@ -220,21 +220,23 @@ class DeleteAccountService < BaseService
 
     return unless keep_account_record?
 
-    @account.silenced_at       = nil
-    @account.suspended_at      = @options[:suspended_at] || Time.now.utc
-    @account.suspension_origin = :local
-    @account.locked            = false
-    @account.memorial          = false
-    @account.discoverable      = false
-    @account.display_name      = ''
-    @account.note              = ''
-    @account.fields            = []
-    @account.statuses_count    = 0
-    @account.followers_count   = 0
-    @account.following_count   = 0
-    @account.moved_to_account  = nil
-    @account.also_known_as     = []
-    @account.trust_level       = :untrusted
+    @account.silenced_at         = nil
+    @account.suspended_at        = @options[:suspended_at] || Time.now.utc
+    @account.suspension_origin   = :local
+    @account.locked              = false
+    @account.memorial            = false
+    @account.discoverable        = false
+    @account.trendable           = false
+    @account.display_name        = ''
+    @account.note                = ''
+    @account.fields              = []
+    @account.statuses_count      = 0
+    @account.followers_count     = 0
+    @account.following_count     = 0
+    @account.moved_to_account    = nil
+    @account.reviewed_at         = nil
+    @account.requested_review_at = nil
+    @account.also_known_as       = []
     @account.avatar.destroy
     @account.header.destroy
     @account.save!
diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb
index a0ab3b4b7..0ca0081b4 100644
--- a/app/services/favourite_service.rb
+++ b/app/services/favourite_service.rb
@@ -17,6 +17,8 @@ class FavouriteService < BaseService
 
     favourite = Favourite.create!(account: account, status: status)
 
+    Trends.statuses.register(status)
+
     create_notification(favourite)
     bump_potential_friendship(account, status)
 
diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb
index 6556fbff7..97f9f8e92 100644
--- a/app/services/reblog_service.rb
+++ b/app/services/reblog_service.rb
@@ -30,8 +30,7 @@ class ReblogService < BaseService
 
     reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility, rate_limit: options[:with_rate_limit])
 
-    Trends.tags.register(reblog)
-    Trends.links.register(reblog)
+    Trends.register!(reblog)
     DistributionWorker.perform_async(reblog.id)
     ActivityPub::DistributionWorker.perform_async(reblog.id) unless reblogged_status.local_only?