[GITEA] Add ThreadID parameter for Telegram webhooks

(cherry picked from commit 29d77def40)
(cherry picked from commit c758aa56a2)
(cherry picked from commit 21c3477875)
This commit is contained in:
neveraskedtoexist 2023-07-19 21:46:29 +02:00 committed by Earl Warren
parent 0fcfb355af
commit 7553b69bea
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 9 additions and 1 deletions

View file

@ -425,12 +425,13 @@ func telegramHookParams(ctx *context.Context) webhookParams {
return webhookParams{
Type: webhook_module.TELEGRAM,
URL: fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=%s", url.PathEscape(form.BotToken), url.QueryEscape(form.ChatID)),
URL: fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=%s&message_thread_id=%s", url.PathEscape(form.BotToken), url.QueryEscape(form.ChatID), url.QueryEscape(form.ThreadID)),
ContentType: webhook.ContentTypeJSON,
WebhookForm: form.WebhookForm,
Meta: &webhook_service.TelegramMeta{
BotToken: form.BotToken,
ChatID: form.ChatID,
ThreadID: form.ThreadID,
},
}
}