diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/media_attachment.rb | 4 | ||||
-rw-r--r-- | app/models/status.rb | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 1741d20e9..0a9d05f1d 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -208,6 +208,10 @@ class MediaAttachment < ApplicationRecord file.blank? && remote_url.present? end + def significantly_changed? + description_previously_changed? || thumbnail_updated_at_previously_changed? || file_meta_previously_changed? + end + def larger_media_format? video? || gifv? || audio? end diff --git a/app/models/status.rb b/app/models/status.rb index 47671c0f5..4fabf24ef 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -209,6 +209,16 @@ class Status < ApplicationRecord public_visibility? || unlisted_visibility? end + def snapshot!(media_attachments_changed: false, account_id: nil, at_time: nil) + edits.create!( + text: text, + spoiler_text: spoiler_text, + media_attachments_changed: media_attachments_changed, + account_id: account_id || self.account_id, + created_at: at_time || edited_at + ) + end + def edited? edited_at.present? end |