MM-35805: following a thread should mark it as read (#17717)

Currently upon following a thread the thread is unread,
this commit changes that by explicitly marking it as read.
Этот коммит содержится в:
Kyriakos Z
2021-06-07 17:49:24 +00:00
коммит произвёл GitHub
родитель 5ce5ea93f4
Коммит 12e439a98d
2 изменённых файлов: 2 добавлений и 1 удалений

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

@@ -5746,6 +5746,7 @@ func TestFollowThreads(t *testing.T) {
}) })
CheckNoError(t, resp) CheckNoError(t, resp)
require.Len(t, uss.Threads, 1) require.Len(t, uss.Threads, 1)
require.GreaterOrEqual(t, uss.Threads[0].LastViewedAt, uss.Threads[0].LastReplyAt)
}) })
} }

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

@@ -2350,7 +2350,7 @@ func (a *App) UpdateThreadsReadForUser(userID, teamID string) *model.AppError {
} }
func (a *App) UpdateThreadFollowForUser(userID, teamID, threadID string, state bool) *model.AppError { func (a *App) UpdateThreadFollowForUser(userID, teamID, threadID string, state bool) *model.AppError {
_, err := a.Srv().Store.Thread().MaintainMembership(userID, threadID, state, false, true, false, false) _, err := a.Srv().Store.Thread().MaintainMembership(userID, threadID, state, false, true, state, false)
if err != nil { if err != nil {
return model.NewAppError("UpdateThreadFollowForUser", "app.user.update_thread_follow_for_user.app_error", nil, err.Error(), http.StatusInternalServerError) return model.NewAppError("UpdateThreadFollowForUser", "app.user.update_thread_follow_for_user.app_error", nil, err.Error(), http.StatusInternalServerError)
} }