Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
12dce033d6
Коммит
21a86506f9
@@ -371,7 +371,7 @@ func (a *App) CreateWebhookPost(c request.CTX, userID string, channel *model.Cha
|
||||
}
|
||||
|
||||
for _, split := range splits {
|
||||
if _, err = a.CreatePost(c, split, channel, model.CreatePostFlags{}); err != nil {
|
||||
if _, _, err := a.CreatePost(c, split, channel, model.CreatePostFlags{}); err != nil {
|
||||
return nil, model.NewAppError("CreateWebhookPost", "api.post.create_webhook_post.creating.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
}
|
||||
@@ -847,7 +847,12 @@ func (a *App) HandleIncomingWebhook(c request.CTX, hookID string, req *model.Inc
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.user.app_error", map[string]any{"user": hook.UserId}, "", http.StatusForbidden).Wrap(resultU.NErr)
|
||||
}
|
||||
|
||||
if channel.Type != model.ChannelTypeOpen && !a.HasPermissionToChannel(c, hook.UserId, channel.Id, model.PermissionReadChannelContent) {
|
||||
restrictedChannel := false
|
||||
if channel.Type != model.ChannelTypeOpen {
|
||||
hasPermission, _ := a.HasPermissionToChannel(c, hook.UserId, channel.Id, model.PermissionReadChannelContent)
|
||||
restrictedChannel = !hasPermission
|
||||
}
|
||||
if restrictedChannel {
|
||||
return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.permissions.app_error", map[string]any{"user": hook.UserId, "channel": channel.Id}, "", http.StatusForbidden)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user