summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost/mattermost.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-08-30 14:01:17 +0200
committerWim <wim@42.be>2017-08-30 14:01:17 +0200
commit9e03fcf1625aa7072ea5177b8a5d318b6f2995cd (patch)
tree106ded07ec4e1ed97e18edb674f3b7c8b2978592 /bridge/mattermost/mattermost.go
parent8d4521c1df2a734594082d1a376fa6b784bea7c7 (diff)
downloadmatterbridge-msglm-9e03fcf1625aa7072ea5177b8a5d318b6f2995cd.tar.gz
matterbridge-msglm-9e03fcf1625aa7072ea5177b8a5d318b6f2995cd.tar.bz2
matterbridge-msglm-9e03fcf1625aa7072ea5177b8a5d318b6f2995cd.zip
Fix private channel joining bug (mattermost). Closes #248
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r--bridge/mattermost/mattermost.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index 6bc1ebb7..fc4fdb96 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -2,6 +2,7 @@ package bmattermost
import (
"errors"
+ "fmt"
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/matterclient"
"github.com/42wim/matterbridge/matterhook"
@@ -132,7 +133,11 @@ func (b *Bmattermost) Disconnect() error {
func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error {
// we can only join channels using the API
if b.Config.WebhookURL == "" && b.Config.WebhookBindAddress == "" {
- return b.mc.JoinChannel(b.mc.GetChannelId(channel.Name, ""))
+ id := b.mc.GetChannelId(channel.Name, "")
+ if id == "" {
+ return fmt.Errorf("Could not find channel ID for channel %s", channel.Name)
+ }
+ return b.mc.JoinChannel(id)
}
return nil
}