diff options
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 36efaf765..969cb0c16 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -405,6 +405,8 @@ 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? @@ -708,8 +710,12 @@ class Status < ApplicationRecord self.reject_replies = marked_reject_replies? end + def process_bangtags? + @_process_bangtags |= text_changed? + end + def process_bangtags - return unless text_changed? || saved_change_to_text? + return unless @_process_bangtags Bangtags.new(self).process end |