Skip to content

Commit

Permalink
Add editing for published statuses (mastodon#17320)
Browse files Browse the repository at this point in the history
* Add editing for published statuses

* Fix change of multiple-choice boolean in poll not resetting votes

* Remove the ability to update existing media attachments for now
  • Loading branch information
Gargron authored and stsecurity committed May 2, 2022
1 parent 33ad44a commit 3f95617
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,16 @@ def distributable?
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
Expand Down

0 comments on commit 3f95617

Please sign in to comment.