summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-01-07 00:26:11 +0100
committerWim <wim@42.be>2019-01-07 00:26:11 +0100
commit56749dfb205857c6f3877f016ffe2b4ba4014725 (patch)
tree31b890ddd278507cff87698858bf9b1dfcdf7eb8 /gateway
parent04567c765e92ad60c685c1b2fe7e77c46e065645 (diff)
downloadmatterbridge-msglm-56749dfb205857c6f3877f016ffe2b4ba4014725.tar.gz
matterbridge-msglm-56749dfb205857c6f3877f016ffe2b4ba4014725.tar.bz2
matterbridge-msglm-56749dfb205857c6f3877f016ffe2b4ba4014725.zip
Fail if channel starts with hashtag (mattermost). Closes #625
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index 732c9bcb..6fe19963 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -1,6 +1,7 @@
package gateway
import (
+ "os"
"regexp"
"strings"
"time"
@@ -138,6 +139,10 @@ func (gw *Gateway) mapChannelConfig(cfg []config.Bridge, direction string) {
if strings.HasPrefix(br.Account, "irc.") {
br.Channel = strings.ToLower(br.Channel)
}
+ if strings.HasPrefix(br.Account, "mattermost.") && strings.HasPrefix(br.Channel, "#") {
+ flog.Errorf("Mattermost channels do not start with a #: remove the # in %s", br.Channel)
+ os.Exit(1)
+ }
ID := br.Channel + br.Account
if _, ok := gw.Channels[ID]; !ok {
channel := &config.ChannelInfo{Name: br.Channel, Direction: direction, ID: ID, Options: br.Options, Account: br.Account,