Change Channel.GetChannelUnread to sync (#10804)

* Change Channel.GetChannelUnread to sync

* Address comments
Этот коммит содержится в:
Shobhit Gupta
2019-05-07 09:15:12 -07:00
коммит произвёл Jesús Espino
родитель efe9d0a5f8
Коммит 9ab3cc9051
5 изменённых файлов: 33 добавлений и 30 удалений

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

@@ -1342,11 +1342,10 @@ func (a *App) GetChannelCounts(teamId string, userId string) (*model.ChannelCoun
}
func (a *App) GetChannelUnread(channelId, userId string) (*model.ChannelUnread, *model.AppError) {
result := <-a.Srv.Store.Channel().GetChannelUnread(channelId, userId)
if result.Err != nil {
return nil, result.Err
channelUnread, err := a.Srv.Store.Channel().GetChannelUnread(channelId, userId)
if err != nil {
return nil, err
}
channelUnread := result.Data.(*model.ChannelUnread)
if channelUnread.NotifyProps[model.MARK_UNREAD_NOTIFY_PROP] == model.CHANNEL_MARK_UNREAD_MENTION {
channelUnread.MsgCount = 0