[MM-17068] send mark as unread event through websocket (#12074)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
05c2a134ac
Коммит
c1eba4fa1e
@@ -1802,7 +1802,17 @@ func (a *App) MarkChannelAsUnreadFromPost(postID string, userID string) (*model.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return a.Srv.Store.Channel().UpdateLastViewedAtPost(post, userID, unreadMentions)
|
||||
channel, updateErr := a.Srv.Store.Channel().UpdateLastViewedAtPost(post, userID, unreadMentions)
|
||||
if err != nil {
|
||||
return channel, updateErr
|
||||
}
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_UNREAD, channel.TeamId, channel.ChannelId, channel.UserId, nil)
|
||||
message.Add("msg_count", channel.MsgCount)
|
||||
message.Add("mention_count", channel.MentionCount)
|
||||
message.Add("last_viewed_at", channel.LastViewedAt)
|
||||
message.Add("post_id", postID)
|
||||
a.Publish(message)
|
||||
return channel, nil
|
||||
}
|
||||
|
||||
func (a *App) esAutocompleteChannels(teamId, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
|
||||
@@ -14,6 +14,7 @@ const (
|
||||
WEBSOCKET_EVENT_POSTED = "posted"
|
||||
WEBSOCKET_EVENT_POST_EDITED = "post_edited"
|
||||
WEBSOCKET_EVENT_POST_DELETED = "post_deleted"
|
||||
WEBSOCKET_EVENT_POST_UNREAD = "post_unread"
|
||||
WEBSOCKET_EVENT_CHANNEL_CONVERTED = "channel_converted"
|
||||
WEBSOCKET_EVENT_CHANNEL_CREATED = "channel_created"
|
||||
WEBSOCKET_EVENT_CHANNEL_DELETED = "channel_deleted"
|
||||
|
||||
Ссылка в новой задаче
Block a user