summaryrefslogtreecommitdiffstats
path: root/bridge/bridge.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-03-16 23:05:11 +0100
committerWim <wim@42.be>2017-03-16 23:05:11 +0100
commitfd8cfb11fb3d5e84ab44b14474b3421a1d49d1b1 (patch)
tree06cacca06ae01f774a2345c734b2098fdda9e031 /bridge/bridge.go
parent9407aa4600668a3adec0ef9fbf7475a6b95ebdaa (diff)
downloadmatterbridge-msglm-fd8cfb11fb3d5e84ab44b14474b3421a1d49d1b1.tar.gz
matterbridge-msglm-fd8cfb11fb3d5e84ab44b14474b3421a1d49d1b1.tar.bz2
matterbridge-msglm-fd8cfb11fb3d5e84ab44b14474b3421a1d49d1b1.zip
Fail when bridge is unable to join a channel (general)
Diffstat (limited to 'bridge/bridge.go')
-rw-r--r--bridge/bridge.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/bridge/bridge.go b/bridge/bridge.go
index 312792b6..12fb71d7 100644
--- a/bridge/bridge.go
+++ b/bridge/bridge.go
@@ -84,8 +84,14 @@ func New(cfg *config.Config, bridge *config.Bridge, c chan config.Message) *Brid
func (b *Bridge) JoinChannels() error {
exists := make(map[string]bool)
- b.joinChannels(b.ChannelsIn, exists)
- b.joinChannels(b.ChannelsOut, exists)
+ err := b.joinChannels(b.ChannelsIn, exists)
+ if err != nil {
+ return err
+ }
+ err = b.joinChannels(b.ChannelsOut, exists)
+ if err != nil {
+ return err
+ }
return nil
}
@@ -99,7 +105,10 @@ func (b *Bridge) joinChannels(cMap map[string]config.ChannelOptions, exists map[
log.Debugf("using key %s for channel %s", info.Key, channel)
mychannel = mychannel + " " + info.Key
}
- b.JoinChannel(mychannel)
+ err := b.JoinChannel(mychannel)
+ if err != nil {
+ return err
+ }
exists[channel] = true
}
}