[MM-16562] Migrate User.GetUnreadCountForChannel to Sync by default (#11604)

* Migrate User.GetUnreadCountForChannel to Sync by default

* Remove else block from GetUnreadCountChannel in user_store.go

* Return nil value for count when an error occurs in GetUnreadCountForChannel

* Fix linting issue in user_store.go
Этот коммит содержится в:
Allan Guwatudde
2019-07-11 15:52:56 +03:00
коммит произвёл Maria A Nunez
родитель 5690df9d95
Коммит e8f77daa8a
6 изменённых файлов: 27 добавлений и 21 удалений

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

@@ -1842,8 +1842,7 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, currentSe
}
}
} else if notify == model.USER_NOTIFY_MENTION || channel.Type == model.CHANNEL_DIRECT {
if result := <-a.Srv.Store.User().GetUnreadCountForChannel(userId, channelId); result.Err == nil {
count := result.Data.(int64)
if count, err := a.Srv.Store.User().GetUnreadCountForChannel(userId, channelId); err == nil {
if count > 0 {
channelsToClearPushNotifications = append(channelsToClearPushNotifications, channelId)
}