about summary refs log tree commit diff
path: root/app/models/status_edit.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-10-26 13:42:29 +0200
committerGitHub <noreply@github.com>2022-10-26 13:42:29 +0200
commitf8ca3bb2a1dd648f41e8fea5b5eb87b53bc8d521 (patch)
tree442181ac32f6c8a9601619aa9c94635c09fc02ce /app/models/status_edit.rb
parentdee69be60ef72f714ca3cbbd47e83f1015332f06 (diff)
Add ability to view previous edits of a status in admin UI (#19462)
* Add ability to view previous edits of a status in admin UI

* Change moderator access to posts to be controlled by a separate policy
Diffstat (limited to 'app/models/status_edit.rb')
-rw-r--r--app/models/status_edit.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb
index e9c8fbe98..e33470226 100644
--- a/app/models/status_edit.rb
+++ b/app/models/status_edit.rb
@@ -30,7 +30,7 @@ class StatusEdit < ApplicationRecord
              :preview_remote_url, :text_url, :meta, :blurhash,
              :not_processed?, :needs_redownload?, :local?,
              :file, :thumbnail, :thumbnail_remote_url,
-             :shortcode, to: :media_attachment
+             :shortcode, :video?, :audio?, to: :media_attachment
   end
 
   rate_limit by: :account, family: :statuses
@@ -40,7 +40,8 @@ class StatusEdit < ApplicationRecord
 
   default_scope { order(id: :asc) }
 
-  delegate :local?, to: :status
+  delegate :local?, :application, :edited?, :edited_at,
+           :discarded?, :visibility, to: :status
 
   def emojis
     return @emojis if defined?(@emojis)
@@ -59,4 +60,12 @@ class StatusEdit < ApplicationRecord
       end
     end
   end
+
+  def proper
+    self
+  end
+
+  def reblog?
+    false
+  end
 end