summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-01-05 15:27:42 +0100
committerJoram Wilander <jwawilander@gmail.com>2018-01-05 09:27:42 -0500
commita5bbf3f64366110c97a3d9d2014623ce0c224be4 (patch)
treea7fe68a32e71d5d5928b99597192fa6bdc0a2281
parent74eb82cfaa5e90d9014ccf21cfa559495ef44745 (diff)
downloadchat-a5bbf3f64366110c97a3d9d2014623ce0c224be4.tar.gz
chat-a5bbf3f64366110c97a3d9d2014623ce0c224be4.tar.bz2
chat-a5bbf3f64366110c97a3d9d2014623ce0c224be4.zip
PLT-8483: Ignore join/leave team messages for unread counts (#8042)
-rw-r--r--store/sqlstore/post_store.go6
1 files changed, 4 insertions, 2 deletions
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