From a5bbf3f64366110c97a3d9d2014623ce0c224be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 5 Jan 2018 15:27:42 +0100 Subject: PLT-8483: Ignore join/leave team messages for unread counts (#8042) --- store/sqlstore/post_store.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'store/sqlstore') diff --git a/store/sqlstore/post_store.go b/store/sqlstore/post_store.go index f3305903b..bc336e70d 100644 --- a/store/sqlstore/post_store.go +++ b/store/sqlstore/post_store.go @@ -98,8 +98,10 @@ func (s SqlPostStore) Save(post *model.Post) store.StoreChannel { } else { time := post.UpdateAt - if post.Type != model.POST_JOIN_LEAVE && post.Type != model.POST_JOIN_CHANNEL && post.Type != model.POST_LEAVE_CHANNEL && - post.Type != model.POST_ADD_REMOVE && post.Type != model.POST_ADD_TO_CHANNEL && post.Type != model.POST_REMOVE_FROM_CHANNEL { + if post.Type != model.POST_JOIN_LEAVE && post.Type != model.POST_ADD_REMOVE && + post.Type != model.POST_JOIN_CHANNEL && post.Type != model.POST_LEAVE_CHANNEL && + post.Type != model.POST_JOIN_TEAM && post.Type != model.POST_LEAVE_TEAM && + post.Type != model.POST_ADD_TO_CHANNEL && post.Type != model.POST_REMOVE_FROM_CHANNEL { s.GetMaster().Exec("UPDATE Channels SET LastPostAt = :LastPostAt, TotalMsgCount = TotalMsgCount + 1 WHERE Id = :ChannelId", map[string]interface{}{"LastPostAt": time, "ChannelId": post.ChannelId}) } else { // don't update TotalMsgCount for unimportant messages so that the channel isn't marked as unread -- cgit v1.2.3-1-g7c22