UserStore migration (#15563)
* Migration completed * Fix tests * Fix tests * Fix tests * Suggestions * Trigger CI * Suggestions * Merge with master * Trigger CI Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d51d843fcd
Коммит
96f1739f8f
@@ -676,7 +676,7 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq
|
||||
uchan := make(chan store.StoreResult, 1)
|
||||
go func() {
|
||||
user, err := a.Srv().Store.User().Get(hook.UserId)
|
||||
uchan <- store.StoreResult{Data: user, Err: err}
|
||||
uchan <- store.StoreResult{Data: user, NErr: err}
|
||||
close(uchan)
|
||||
}()
|
||||
|
||||
@@ -700,7 +700,7 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq
|
||||
if len(channelName) != 0 {
|
||||
if channelName[0] == '@' {
|
||||
if result, err := a.Srv().Store.User().GetByUsername(channelName[1:]); err != nil {
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.user.app_error", nil, "err="+err.Message, http.StatusBadRequest)
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.user.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
} else {
|
||||
if ch, err := a.GetOrCreateDirectChannel(hook.UserId, result.Id); err != nil {
|
||||
return err
|
||||
@@ -757,8 +757,8 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq
|
||||
}
|
||||
|
||||
var user *model.User
|
||||
if result := <-uchan; result.Err != nil {
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.user.app_error", nil, "err="+result.Err.Message, http.StatusForbidden)
|
||||
if result := <-uchan; result.NErr != nil {
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.user.app_error", nil, result.NErr.Error(), http.StatusForbidden)
|
||||
} else {
|
||||
user = result.Data.(*model.User)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user