From f8ad87760145c305db988c499ed4d8e9c1f5e0d5 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 2 Feb 2020 18:53:04 +0100 Subject: Add DisableWebPagePreview option (telegram). Closes #980 (#994) --- bridge/config/config.go | 1 + bridge/telegram/telegram.go | 3 +++ 2 files changed, 4 insertions(+) (limited to 'bridge') diff --git a/bridge/config/config.go b/bridge/config/config.go index 105d568f..84e8f75f 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -79,6 +79,7 @@ type Protocol struct { ColorNicks bool // only irc for now Debug bool // general DebugLevel int // only for irc now + DisableWebPagePreview bool // telegram EditSuffix string // mattermost, slack, discord, telegram, gitter EditDisable bool // mattermost, slack, discord, telegram, gitter IconURL string // mattermost, slack diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index c7ead21f..ac45985e 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -131,6 +131,9 @@ func (b *Btelegram) sendMessage(chatid int64, username, text string) (string, er m.Text = username + html.EscapeString(text) m.ParseMode = tgbotapi.ModeHTML } + + m.DisableWebPagePreview = b.GetBool("DisableWebPagePreview") + res, err := b.c.Send(m) if err != nil { return "", err -- cgit v1.2.3