diff options
author | Wim <wim@42.be> | 2020-05-14 00:37:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 00:37:41 +0200 |
commit | d44598a900a9c28445ec55d4572b27c7146bcd83 (patch) | |
tree | 451dbf999f6a6514825e866f69b053f636a05997 /bridge/matrix | |
parent | c9cfa59f5453add42fb3dd9cc29bdc0d692b2077 (diff) | |
download | matterbridge-msglm-d44598a900a9c28445ec55d4572b27c7146bcd83.tar.gz matterbridge-msglm-d44598a900a9c28445ec55d4572b27c7146bcd83.tar.bz2 matterbridge-msglm-d44598a900a9c28445ec55d4572b27c7146bcd83.zip |
Add an option to disable sending HTML to matrix. Fixes #1022 (#1135)
Diffstat (limited to 'bridge/matrix')
-rw-r--r-- | bridge/matrix/matrix.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 78779c87..6521fe86 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -124,6 +124,14 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) { return resp.EventID, err } + if b.GetBool("HTMLDisable") { + resp, err := b.mc.SendText(channel, msg.Username+msg.Text) + if err != nil { + return "", err + } + return resp.EventID, err + } + username := html.EscapeString(msg.Username) // check if we have a </tag>. if we have, we don't escape HTML. #696 if b.htmlTag.MatchString(msg.Username) { |