about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/lib/bangtags.rb2
-rw-r--r--app/models/status.rb9
2 files changed, 7 insertions, 4 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index ed44eb267..d922be84b 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -587,7 +587,7 @@ class Bangtags
         when 'publish'
           chunk = nil
           del_tags(@parent_status, 'self.draft', 'draft')
-          Bangtags.new(@parent_status).process
+          @parent_status.process_bangtags!
           PostStatusWorker.perform_async(@parent_status.id, hidden: false, process_mentions: true)
         end
 
diff --git a/app/models/status.rb b/app/models/status.rb
index 969cb0c16..15ad76944 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -395,6 +395,7 @@ class Status < ApplicationRecord
   around_create Mastodon::Snowflake::Callbacks
 
   before_create :set_locality
+  before_create :process_bangtags?, if: :local?
 
   before_validation :prepare_contents, if: :local?
   before_validation :set_reblog
@@ -405,8 +406,6 @@ class Status < ApplicationRecord
 
   after_create :set_poll_id
 
-  before_save :process_bangtags?, if: :local?
-
   after_save :update_sharekey, if: :local?
   after_save :update_origin, if: :local?
   after_save :process_bangtags, if: :local?
@@ -714,9 +713,13 @@ class Status < ApplicationRecord
     @_process_bangtags |= text_changed?
   end
 
+  def process_bangtags!
+    Bangtags.new(self).process
+  end
+
   def process_bangtags
     return unless @_process_bangtags
-    Bangtags.new(self).process
+    process_bangtags!
   end
 
   def update_sharekey