MM-17071 Add mention counting when marking a post as unread (#11966)

* Add different types for different mentions

* Remove redundant THREAD_ANY and THREAD_ROOT constants

* Make PostStore.Get return thread in order

* MM-17071 Add initial version of countMentionsFromPost

* MM-17071 Refactor comment mention counting

* MM-17071 Use mention counting when marking post as unread

* Fix shadowing in tests

* Remove repeated check of user count

* Refactor code using MentionType

* Update comments around -1 return value

* Move inner functions out of countMentionsFromPost

* Remove preconditions check as separate test case

* Update comments

* Add User.GetMentionKeys

* Revert "Make PostStore.Get return thread in order"

This reverts commit 22aa010cee359655fe75e1dc899cf0ffb0943c2a.

* Fix tests

* Fix merge conflict

* Add store.MentionAllPosts
Этот коммит содержится в:
Harrison Healey
2019-09-19 10:10:10 -04:00
коммит произвёл GitHub
родитель 5f28ce9de0
Коммит e6f67c664c
11 изменённых файлов: 1457 добавлений и 415 удалений

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

@@ -160,11 +160,11 @@ func (a *App) getPushNotificationMessage(postMessage string, explicitMention, ch
return senderName + userLocale("api.post.send_notifications_and_forget.push_explicit_mention")
}
if replyToThreadType == THREAD_ROOT {
if replyToThreadType == model.COMMENTS_NOTIFY_ROOT {
return senderName + userLocale("api.post.send_notification_and_forget.push_comment_on_post")
}
if replyToThreadType == THREAD_ANY {
if replyToThreadType == model.COMMENTS_NOTIFY_ANY {
return senderName + userLocale("api.post.send_notification_and_forget.push_comment_on_thread")
}