MM-42581: fixes unread threads on user channel add (#20181)

* MM-42581: fixes unread threads on user channel add

Currently when we are adding a user to a channel we don't send previous
values for unread replies and mentions. This is resulting the thread to
not be marked as unread in the UI, since we rely on the previous values
for that.

This commit fixes the issue by returning previous unread values of 0.

* Adds test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Kyriakos Z
2022-06-08 21:01:58 +03:00
коммит произвёл GitHub
родитель c986693e4a
Коммит 5396c530bf
2 изменённых файлов: 37 добавлений и 6 удалений

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

@@ -2489,6 +2489,8 @@ func (a *App) UpdateThreadFollowForUserFromChannelAdd(userID, teamID, threadID s
mlog.Warn("Failed to encode thread to JSON")
}
message.Add("thread", string(payload))
message.Add("previous_unread_replies", int64(0))
message.Add("previous_unread_mentions", int64(0))
a.Publish(message)
return nil