From ac4aee39e3256f9061d2057bb377862def4dd9d9 Mon Sep 17 00:00:00 2001 From: Alexandre GV Date: Thu, 13 May 2021 22:39:25 +0200 Subject: discord: Add AllowMention to restrict allowed mentions (#1462) * Add DisablePingEveryoneHere/DisablePingRoles/DisablePingUsers keys to config * Add basic AllowedMentions behavior to discord webhooks * Initialize b.AllowedMentions on Discord Bridger init * Call b.getAllowedMentions on each webhook to allow config hot reloading * Add AllowedMentions on all Discord webhooks/messages * Add DisablePingEveryoneHere/DisablePingRoles/DisablePingUsers to matterbridge.toml.sample * Change 'Disable' for 'Allow' and revert logic in Discord AllowedMentions * Update Discord AllowedMentions in matterbridge.toml.sample * Fix typo in DisableWebPagePreview * Replace 'AllowPingEveryoneHere' with 'AllowPingEveryone' * Replace 3 AllowPingEveryone/Roles/Users bools with an array * Fix typo --- bridge/config/config.go | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'bridge/config/config.go') diff --git a/bridge/config/config.go b/bridge/config/config.go index 98935208..b5e03fcf 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -85,27 +85,28 @@ type ChannelMember struct { type ChannelMembers []ChannelMember type Protocol struct { - AuthCode string // steam - BindAddress string // mattermost, slack // DEPRECATED - Buffer int // api - Charset string // irc - ClientID string // msteams - 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 - HTMLDisable bool // matrix - IconURL string // mattermost, slack - IgnoreFailureOnStart bool // general - IgnoreNicks string // all protocols - IgnoreMessages string // all protocols - Jid string // xmpp - JoinDelay string // all protocols - Label string // all protocols - Login string // mattermost, matrix - LogFile string // general + AllowMention []string // discord + AuthCode string // steam + BindAddress string // mattermost, slack // DEPRECATED + Buffer int // api + Charset string // irc + ClientID string // msteams + 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 + HTMLDisable bool // matrix + IconURL string // mattermost, slack + IgnoreFailureOnStart bool // general + IgnoreNicks string // all protocols + IgnoreMessages string // all protocols + Jid string // xmpp + JoinDelay string // all protocols + Label string // all protocols + Login string // mattermost, matrix + LogFile string // general MediaDownloadBlackList []string MediaDownloadPath string // Basically MediaServerUpload, but instead of uploading it, just write it to a file on the same server. MediaDownloadSize int // all protocols -- cgit v1.2.3