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 Oct 17, 2023
1 parent 4710e10 commit 43a40ff
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 @@ -224,6 +224,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 43a40ff

Please sign in to comment.