From 47d38192b2e3ed9bacdcda81d4c0282fe60d508a Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 23 Oct 2016 20:58:04 +0200 Subject: Only send to channels defined in config. Fixes #53 --- gateway/gateway.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3