summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-02-02 18:53:04 +0100
committerGitHub <noreply@github.com>2020-02-02 18:53:04 +0100
commitf8ad87760145c305db988c499ed4d8e9c1f5e0d5 (patch)
treef82b9f4ca6253e3921a86518f147cfb09cf02f40
parent585d1556c18abc8b259819847d05b2b088bee806 (diff)
downloadmatterbridge-msglm-f8ad87760145c305db988c499ed4d8e9c1f5e0d5.tar.gz
matterbridge-msglm-f8ad87760145c305db988c499ed4d8e9c1f5e0d5.tar.bz2
matterbridge-msglm-f8ad87760145c305db988c499ed4d8e9c1f5e0d5.zip
Add DisableWebPagePreview option (telegram). Closes #980 (#994)
-rw-r--r--bridge/config/config.go1
-rw-r--r--bridge/telegram/telegram.go3
-rw-r--r--matterbridge.toml.sample4
3 files changed, 8 insertions, 0 deletions
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
diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample
index af3c5dfb..d9d596e5 100644
--- a/matterbridge.toml.sample
+++ b/matterbridge.toml.sample
@@ -837,6 +837,10 @@ Token="Yourtokenhere"
#HTMLNick only allows HTML for the nick, the message itself will be html-escaped
MessageFormat=""
+#OPTIONAL (default false)
+#Disables link previews for links in messages
+DisableWebPagePreview=false
+
#If enabled use the "First Name" as username. If this is empty use the Username
#If disabled use the "Username" as username. If this is empty use the First Name
#If all names are empty, username will be "unknown"