Skip to content

Commit 3f95617

Browse files
Gargronstsecurity
authored andcommitted
Add editing for published statuses (mastodon#17320)
* 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
1 parent 33ad44a commit 3f95617

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

app/models/status.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ def distributable?
222222
public_visibility? || unlisted_visibility?
223223
end
224224

225+
def snapshot!(media_attachments_changed: false, account_id: nil, at_time: nil)
226+
edits.create!(
227+
text: text,
228+
spoiler_text: spoiler_text,
229+
media_attachments_changed: media_attachments_changed,
230+
account_id: account_id || self.account_id,
231+
created_at: at_time || edited_at
232+
)
233+
end
234+
225235
def edited?
226236
edited_at.present?
227237
end

0 commit comments

Comments
 (0)