MM-15632 DeleteEphemeralMessage to accept a postId string (#10853)
Before it was accepting `post *model.Post`, and returning one. This is a breaking change for the giphy plugin and any other that rely on the API.
Этот коммит содержится в:
@@ -447,8 +447,8 @@ func (api *PluginAPI) UpdateEphemeralPost(userId string, post *model.Post) *mode
|
||||
return api.app.UpdateEphemeralPost(userId, post)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) DeleteEphemeralPost(userId string, post *model.Post) {
|
||||
api.app.DeleteEphemeralPost(userId, post)
|
||||
func (api *PluginAPI) DeleteEphemeralPost(userId, postId string) {
|
||||
api.app.DeleteEphemeralPost(userId, postId)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) DeletePost(postId string) *model.AppError {
|
||||
|
||||
16
app/post.go
16
app/post.go
@@ -437,16 +437,18 @@ func (a *App) UpdateEphemeralPost(userId string, post *model.Post) *model.Post {
|
||||
return post
|
||||
}
|
||||
|
||||
func (a *App) DeleteEphemeralPost(userId string, post *model.Post) *model.Post {
|
||||
post.Type = model.POST_EPHEMERAL
|
||||
post.DeleteAt = model.GetMillis()
|
||||
post.UpdateAt = post.DeleteAt
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_DELETED, "", post.ChannelId, userId, nil)
|
||||
func (a *App) DeleteEphemeralPost(userId, postId string) {
|
||||
post := &model.Post{
|
||||
Id: postId,
|
||||
UserId: userId,
|
||||
Type: model.POST_EPHEMERAL,
|
||||
DeleteAt: model.GetMillis(),
|
||||
UpdateAt: model.GetMillis(),
|
||||
}
|
||||
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_DELETED, "", "", userId, nil)
|
||||
message.Add("post", post.ToJson())
|
||||
a.Publish(message)
|
||||
|
||||
return post
|
||||
}
|
||||
|
||||
func (a *App) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
|
||||
Ссылка в новой задаче
Block a user