mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 02:53:16 -06:00
add support for status edits in the database, and update status dereferencer to handle them
This commit is contained in:
parent
fc8d3742c9
commit
3e131f5da6
21 changed files with 623 additions and 172 deletions
|
|
@ -52,7 +52,7 @@ func emojiChanged(existing, latest *gtsmodel.Emoji) bool {
|
|||
|
||||
// pollChanged returns whether a poll has changed in way that
|
||||
// indicates that this should be an entirely new poll. i.e. if
|
||||
// the available options have changed, or the expiry has increased.
|
||||
// the available options have changed, or the expiry has changed.
|
||||
func pollChanged(existing, latest *gtsmodel.Poll) bool {
|
||||
return !slices.Equal(existing.Options, latest.Options) ||
|
||||
!existing.ExpiresAt.Equal(latest.ExpiresAt)
|
||||
|
|
@ -70,3 +70,12 @@ func pollUpdated(existing, latest *gtsmodel.Poll) bool {
|
|||
func pollJustClosed(existing, latest *gtsmodel.Poll) bool {
|
||||
return existing.ClosedAt.IsZero() && latest.Closed()
|
||||
}
|
||||
|
||||
// statusChanged returns whether a status has changed in a way that
|
||||
// indicates that existing should be snapshotted for version history.
|
||||
func statusChanged(existing, latest *gtsmodel.Status) bool {
|
||||
return !existing.UpdatedAt.Equal(latest.UpdatedAt) ||
|
||||
existing.Content != latest.Content ||
|
||||
existing.ContentWarning != latest.ContentWarning ||
|
||||
!slices.Equal(existing.AttachmentIDs, latest.AttachmentIDs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue