[MM-14846] Update EditAt for FileIds and Attachment in Post + Ignore FileIds Updates (#10540)
* Set EditAt for FileIds and Attachments; Disallow update/patch of FileIds in API Handler * Add custom comparison methods for StringArray and Post Attachments * gofmt * Split up comparison function to child structs * Naming consistency * gofmt
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
41fe33bbb1
Коммит
7c9837d9b1
@@ -506,6 +506,11 @@ func (a *App) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model
|
||||
newPost.Props = post.Props
|
||||
}
|
||||
|
||||
// Avoid deep-equal checks if EditAt was already modified through message change
|
||||
if newPost.EditAt == oldPost.EditAt && (!oldPost.FileIds.Equals(newPost.FileIds) || !oldPost.AttachmentsEqual(newPost)) {
|
||||
newPost.EditAt = model.GetMillis()
|
||||
}
|
||||
|
||||
if err := a.FillInPostProps(post, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user