diff options
author | Wim <wim@42.be> | 2016-11-20 23:01:44 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2016-11-20 23:01:44 +0100 |
commit | e0e1e4be8018b256d86e2df9c3f84fc7881041c3 (patch) | |
tree | c3b41348cc56cf1d254887dcb5ca102f6377cb9e /gateway | |
parent | d5845ce9009741734b9f25153ebe534b698934ef (diff) | |
download | matterbridge-msglm-e0e1e4be8018b256d86e2df9c3f84fc7881041c3.tar.gz matterbridge-msglm-e0e1e4be8018b256d86e2df9c3f84fc7881041c3.tar.bz2 matterbridge-msglm-e0e1e4be8018b256d86e2df9c3f84fc7881041c3.zip |
Add gateway.inout config for bidirectional bridges. Closes #85
Diffstat (limited to 'gateway')
-rw-r--r-- | gateway/gateway.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index 63da4bba..f45f315e 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -57,7 +57,7 @@ func (gw *Gateway) AddBridge(cfg *config.Bridge) error { func (gw *Gateway) Start() error { gw.mapChannels() - for _, br := range append(gw.MyConfig.In, gw.MyConfig.Out...) { + for _, br := range append(gw.MyConfig.In, append(gw.MyConfig.InOut, gw.MyConfig.Out...)...) { err := gw.AddBridge(&br) if err != nil { return err @@ -92,6 +92,10 @@ func (gw *Gateway) mapChannels() error { m[br.Account] = append(m[br.Account], br.Channel) } gw.ChannelsIn = m + for _, br := range gw.MyConfig.InOut { + gw.ChannelsIn[br.Account] = append(gw.ChannelsIn[br.Account], br.Channel) + gw.ChannelsOut[br.Account] = append(gw.ChannelsOut[br.Account], br.Channel) + } return nil } |