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.
Этот коммит содержится в:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user