loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>
(cherry picked from commit 0285b04f4ca981d7467097dbca3b281011b7798c)

authored by

Denys Konovalov
Giteabot
and committed by
Earl Warren
20f839ad 32380ffa

+12 -1
+3 -1
services/webhook/telegram.go
··· 181 181 182 182 func createTelegramPayload(message string) TelegramPayload { 183 183 return TelegramPayload{ 184 - Message: strings.TrimSpace(message), 184 + Message: strings.TrimSpace(message), 185 + ParseMode: "HTML", 186 + DisableWebPreview: true, 185 187 } 186 188 } 187 189
+9
services/webhook/telegram_test.go
··· 18 18 19 19 func TestTelegramPayload(t *testing.T) { 20 20 tc := telegramConvertor{} 21 + 22 + t.Run("Correct webhook params", func(t *testing.T) { 23 + p := createTelegramPayload("testMsg ") 24 + 25 + assert.Equal(t, "HTML", p.ParseMode) 26 + assert.Equal(t, true, p.DisableWebPreview) 27 + assert.Equal(t, "testMsg", p.Message) 28 + }) 29 + 21 30 t.Run("Create", func(t *testing.T) { 22 31 p := createTestPayload() 23 32