about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 2a5a33ca7..f2ed871e7 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -126,6 +126,8 @@ class Account < ApplicationRecord
   scope :not_excluded_by_account, ->(account) { where.not(id: account.excluded_from_timeline_account_ids) }
   scope :not_domain_blocked_by_account, ->(account) { where(arel_table[:domain].eq(nil).or(arel_table[:domain].not_in(account.excluded_from_timeline_domains))) }
 
+  after_update_commit :trigger_update_webhooks
+
   delegate :email,
            :unconfirmed_email,
            :current_sign_in_at,
@@ -591,4 +593,9 @@ class Account < ApplicationRecord
 
     CanonicalEmailBlock.where(reference_account: self).delete_all
   end
+
+  # NOTE: the `account.created` webhook is triggered by the `User` model, not `Account`.
+  def trigger_update_webhooks
+    TriggerWebhookWorker.perform_async('account.updated', 'Account', id) if local?
+  end
 end