summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortechknowlogick <matti@mdranta.net>2019-04-23 12:12:00 -0400
committerGitHub <noreply@github.com>2019-04-23 12:12:00 -0400
commitcbf8538635763ee8110dd57687d081c4ef3d3791 (patch)
tree3ccea97057e3c29e14b8bb716f3dc96b320d3b99
parent2a0e86d5f28efe20adb66e5734bec5af00f3b238 (diff)
downloadgitea-cbf8538635763ee8110dd57687d081c4ef3d3791.tar.gz
gitea-cbf8538635763ee8110dd57687d081c4ef3d3791.zip
Disable web preview for telegram webhook (#6719)
-rw-r--r--models/webhook_telegram.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/webhook_telegram.go b/models/webhook_telegram.go
index 5680c48b85..9aef0e3ece 100644
--- a/models/webhook_telegram.go
+++ b/models/webhook_telegram.go
@@ -17,8 +17,9 @@ import (
type (
// TelegramPayload represents
TelegramPayload struct {
- Message string `json:"text"`
- ParseMode string `json:"parse_mode"`
+ Message string `json:"text"`
+ ParseMode string `json:"parse_mode"`
+ DisableWebPreview bool `json:"disable_web_page_preview"`
}
// TelegramMeta contains the telegram metadata
@@ -34,6 +35,7 @@ func (p *TelegramPayload) SetSecret(_ string) {}
// JSONPayload Marshals the TelegramPayload to json
func (p *TelegramPayload) JSONPayload() ([]byte, error) {
p.ParseMode = "HTML"
+ p.DisableWebPreview = true
p.Message = markup.Sanitize(p.Message)
data, err := json.MarshalIndent(p, "", " ")
if err != nil {