Skip to content

Commit

Permalink
Add DisableWebPagePreview (telegram). Closes #980
Browse files Browse the repository at this point in the history
  • Loading branch information
42wim committed Feb 2, 2020
1 parent 585d155 commit 5ec15d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions bridge/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions bridge/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions matterbridge.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5ec15d9

Please sign in to comment.