mirror of https://github.com/go-gitea/gitea.git
fix telegram webhook (#29864)
Fix #29837 which is a regression caused by https://github.com/go-gitea/gitea/pull/29145/files#diff-731445ee00f0f1bf2ff731f4f96ddcf51cdc53fd2faaf406eb3536fc292ea748L48. The line was probably removed by accident. --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
df05c558da
commit
0285b04f4c
|
@ -181,7 +181,9 @@ func (t telegramConvertor) Package(p *api.PackagePayload) (TelegramPayload, erro
|
||||||
|
|
||||||
func createTelegramPayload(message string) TelegramPayload {
|
func createTelegramPayload(message string) TelegramPayload {
|
||||||
return TelegramPayload{
|
return TelegramPayload{
|
||||||
Message: strings.TrimSpace(message),
|
Message: strings.TrimSpace(message),
|
||||||
|
ParseMode: "HTML",
|
||||||
|
DisableWebPreview: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,15 @@ import (
|
||||||
|
|
||||||
func TestTelegramPayload(t *testing.T) {
|
func TestTelegramPayload(t *testing.T) {
|
||||||
tc := telegramConvertor{}
|
tc := telegramConvertor{}
|
||||||
|
|
||||||
|
t.Run("Correct webhook params", func(t *testing.T) {
|
||||||
|
p := createTelegramPayload("testMsg ")
|
||||||
|
|
||||||
|
assert.Equal(t, "HTML", p.ParseMode)
|
||||||
|
assert.Equal(t, true, p.DisableWebPreview)
|
||||||
|
assert.Equal(t, "testMsg", p.Message)
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("Create", func(t *testing.T) {
|
t.Run("Create", func(t *testing.T) {
|
||||||
p := createTestPayload()
|
p := createTestPayload()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue