Fixed calculation of mention count for direct channels (#3831)
* Fixed clientside calculation of direct channel mention count * Fixed serverside calculation of direct channel mention count
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
3289c85613
Коммит
9ad50d4d75
@@ -982,7 +982,7 @@ func (us SqlUserStore) GetUnreadCount(userId string) StoreChannel {
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
if count, err := us.GetReplica().SelectInt("SELECT SUM(CASE WHEN c.Type = 'D' THEN (c.TotalMsgCount - cm.MsgCount) ELSE 0 END + cm.MentionCount) FROM Channels c INNER JOIN ChannelMembers cm ON cm.ChannelId = c.Id AND cm.UserId = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
|
||||
if count, err := us.GetReplica().SelectInt("SELECT SUM(CASE WHEN c.Type = 'D' THEN (c.TotalMsgCount - cm.MsgCount) ELSE cm.MentionCount END) FROM Channels c INNER JOIN ChannelMembers cm ON cm.ChannelId = c.Id AND cm.UserId = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
|
||||
result.Err = model.NewLocAppError("SqlUserStore.GetMentionCount", "store.sql_user.get_unread_count.app_error", nil, err.Error())
|
||||
} else {
|
||||
result.Data = count
|
||||
|
||||
Ссылка в новой задаче
Block a user