Revert "MM-42810: Introduce a channel hook for a websocket event (#23812)" (#24107)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2023-07-24 21:46:57 +05:30
коммит произвёл GitHub
родитель e70abd6e0f
Коммит 29bd0c9357
8 изменённых файлов: 155 добавлений и 211 удалений

Просмотреть файл

@@ -484,6 +484,12 @@ func (a *App) SendNotifications(c request.CTX, post *model.Post, team *model.Tea
message := model.NewWebSocketEvent(model.WebsocketEventPosted, "", post.ChannelId, "", nil, "")
// Note that PreparePostForClient should've already been called by this point
postJSON, jsonErr := post.ToJSON()
if jsonErr != nil {
return nil, errors.Wrapf(jsonErr, "failed to encode post to JSON")
}
message.Add("post", postJSON)
message.Add("channel_type", channel.Type)
message.Add("channel_display_name", notification.GetChannelName(model.ShowUsername, ""))
message.Add("channel_name", channel.Name)
@@ -517,10 +523,13 @@ func (a *App) SendNotifications(c request.CTX, post *model.Post, team *model.Tea
message.Add("followers", model.ArrayToJSON(notificationsForCRT.Desktop))
}
err := a.publishWebsocketEventForPost(c, post, message)
published, err := a.publishWebsocketEventForPermalinkPost(c, post, message)
if err != nil {
return nil, err
}
if !published {
a.Publish(message)
}
// If this is a reply in a thread, notify participants
if isCRTAllowed && post.RootId != "" {