Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Daniel Espino García
2024-09-11 10:57:46 +02:00
коммит произвёл GitHub
родитель b898d13e55
Коммит b6bd92f90e

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

@@ -2720,7 +2720,7 @@ func (a *App) MarkChannelAsUnreadFromPost(c request.CTX, postID string, userID s
return channelUnread, model.NewAppError("MarkChannelAsUnreadFromPost", "app.channel.update_last_viewed_at_post.app_error", nil, "", http.StatusInternalServerError).Wrap(nErr)
}
a.sendWebSocketPostUnreadEvent(c, channelUnread, postID, false)
a.sendWebSocketPostUnreadEvent(c, channelUnread, postID)
a.UpdateMobileAppBadge(userID)
return channelUnread, nil
@@ -2756,7 +2756,7 @@ func (a *App) markChannelAsUnreadFromPostCRTUnsupported(c request.CTX, postID st
return channelUnread, model.NewAppError("MarkChannelAsUnreadFromPost", "app.channel.update_last_viewed_at_post.app_error", nil, "", http.StatusInternalServerError).Wrap(nErr)
}
a.sendWebSocketPostUnreadEvent(c, channelUnread, postID, true)
a.sendWebSocketPostUnreadEvent(c, channelUnread, postID)
a.UpdateMobileAppBadge(userID)
return channelUnread, nil
}
@@ -2829,17 +2829,15 @@ func (a *App) markChannelAsUnreadFromPostCRTUnsupported(c request.CTX, postID st
if nErr != nil {
return channelUnread, model.NewAppError("MarkChannelAsUnreadFromPost", "app.channel.update_last_viewed_at_post.app_error", nil, "", http.StatusInternalServerError).Wrap(nErr)
}
a.sendWebSocketPostUnreadEvent(c, channelUnread, postID, false)
a.sendWebSocketPostUnreadEvent(c, channelUnread, postID)
a.UpdateMobileAppBadge(userID)
return channelUnread, nil
}
func (a *App) sendWebSocketPostUnreadEvent(c request.CTX, channelUnread *model.ChannelUnreadAt, postID string, withMsgCountRoot bool) {
func (a *App) sendWebSocketPostUnreadEvent(c request.CTX, channelUnread *model.ChannelUnreadAt, postID string) {
message := model.NewWebSocketEvent(model.WebsocketEventPostUnread, channelUnread.TeamId, channelUnread.ChannelId, channelUnread.UserId, nil, "")
message.Add("msg_count", channelUnread.MsgCount)
if withMsgCountRoot {
message.Add("msg_count_root", channelUnread.MsgCountRoot)
}
message.Add("msg_count_root", channelUnread.MsgCountRoot)
message.Add("mention_count", channelUnread.MentionCount)
message.Add("mention_count_root", channelUnread.MentionCountRoot)
message.Add("urgent_mention_count", channelUnread.UrgentMentionCount)