summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-10-23 20:58:04 +0200
committerWim <wim@42.be>2016-10-23 20:58:04 +0200
commit47d38192b2e3ed9bacdcda81d4c0282fe60d508a (patch)
treee4eefb2531e04b7e2248b408d910929239a5c692 /gateway
parentac80c470363b08da20a45046b7abc4193101e875 (diff)
downloadmatterbridge-msglm-47d38192b2e3ed9bacdcda81d4c0282fe60d508a.tar.gz
matterbridge-msglm-47d38192b2e3ed9bacdcda81d4c0282fe60d508a.tar.bz2
matterbridge-msglm-47d38192b2e3ed9bacdcda81d4c0282fe60d508a.zip
Only send to channels defined in config. Fixes #53
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index 6f797997..45bb9e34 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -90,7 +90,13 @@ func (gw *Gateway) mapIgnores() {
}
func (gw *Gateway) getDestChannel(msg *config.Message, dest string) []string {
- return gw.ChannelsOut[dest]
+ channels := gw.ChannelsIn[msg.FullOrigin]
+ for _, channel := range channels {
+ if channel == msg.Channel {
+ return gw.ChannelsOut[dest]
+ }
+ }
+ return []string{}
}
func (gw *Gateway) handleMessage(msg config.Message, dest bridge.Bridge) {