MM-36687 CRT push notifications (#18347)

* CRT changes

* Lint fix

* Moved postId check

* Moved postId check

* Lint fix

* Misc

* Added test case for badge count while clearing notifications

* Fixed count when CRT is on and added isCRTEnabled, teamId to isIdLoaded notifications

* test fix

* isCRTEnabledForUser capitalised

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Anurag Shivarathri
2021-11-15 10:41:47 +05:30
коммит произвёл GitHub
родитель 929caaff3d
Коммит 65c670a4c9
15 изменённых файлов: 136 добавлений и 70 удалений

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

@@ -66,7 +66,7 @@ func (a *App) CreatePostAsUser(c *request.Context, post *model.Post, currentSess
// the post is NOT a reply post with CRT enabled
_, fromWebhook := post.GetProps()["from_webhook"]
_, fromBot := post.GetProps()["from_bot"]
isCRTReply := post.RootId != "" && a.isCRTEnabledForUser(post.UserId)
isCRTReply := post.RootId != "" && a.IsCRTEnabledForUser(post.UserId)
if !fromWebhook && !fromBot && !isCRTReply {
if _, err := a.MarkChannelsAsViewed([]string{post.ChannelId}, post.UserId, currentSessionId, true); err != nil {
mlog.Warn(