MM-31713 Server/API: GetUserThread method (#16659)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c14194d78b
Коммит
77da23e84b
13
app/user.go
13
app/user.go
@@ -2371,6 +2371,19 @@ func (a *App) GetThreadsForUser(userId, teamId string, options model.GetUserThre
|
||||
return threads, nil
|
||||
}
|
||||
|
||||
func (a *App) GetThreadForUser(userId, teamId, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) {
|
||||
thread, err := a.Srv().Store.Thread().GetThreadForUser(userId, teamId, threadId, extended)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("GetThreadForUser", "app.user.get_threads_for_user.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
if thread == nil {
|
||||
return nil, model.NewAppError("GetThreadForUser", "app.user.get_threads_for_user.not_found", nil, "thread not found/followed", http.StatusNotFound)
|
||||
}
|
||||
a.sanitizeProfiles(thread.Participants, false)
|
||||
thread.Post.SanitizeProps()
|
||||
return thread, nil
|
||||
}
|
||||
|
||||
func (a *App) UpdateThreadsReadForUser(userId, teamId string) *model.AppError {
|
||||
nErr := a.Srv().Store.Thread().MarkAllAsRead(userId, teamId)
|
||||
if nErr != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user