5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-25 06:21:36 +00:00

Only send to channels defined in config. Fixes #53

This commit is contained in:
Wim 2016-10-23 20:58:04 +02:00
parent ac80c47036
commit 47d38192b2

View File

@ -90,8 +90,14 @@ func (gw *Gateway) mapIgnores() {
} }
func (gw *Gateway) getDestChannel(msg *config.Message, dest string) []string { func (gw *Gateway) getDestChannel(msg *config.Message, dest string) []string {
channels := gw.ChannelsIn[msg.FullOrigin]
for _, channel := range channels {
if channel == msg.Channel {
return gw.ChannelsOut[dest] return gw.ChannelsOut[dest]
} }
}
return []string{}
}
func (gw *Gateway) handleMessage(msg config.Message, dest bridge.Bridge) { func (gw *Gateway) handleMessage(msg config.Message, dest bridge.Bridge) {
if gw.ignoreMessage(&msg) { if gw.ignoreMessage(&msg) {