summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost/mattermost.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-08-15 23:16:07 +0200
committerWim <wim@42.be>2016-08-20 18:08:57 +0200
commit889b6debc4f339975076668b6ab7d85f7dd08922 (patch)
tree04ca8ee5be4ecb7f87f28e46e81045a9df1d3b25 /bridge/mattermost/mattermost.go
parent9cb3413d9c79730fc3b61bfdef6b2c9a2003a383 (diff)
downloadmatterbridge-msglm-889b6debc4f339975076668b6ab7d85f7dd08922.tar.gz
matterbridge-msglm-889b6debc4f339975076668b6ab7d85f7dd08922.tar.bz2
matterbridge-msglm-889b6debc4f339975076668b6ab7d85f7dd08922.zip
Add Connect() to Bridger interface
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r--bridge/mattermost/mattermost.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index 63f38dc5..9dc0cebb 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -55,6 +55,14 @@ func New(cfg *config.Config, c chan config.Message) *Bmattermost {
b.Remote = c
b.Plus = cfg.General.Plus
b.mmMap = make(map[string]string)
+ return b
+}
+
+func (b *Bmattermost) Command(cmd string) string {
+ return ""
+}
+
+func (b *Bmattermost) Connect() error {
if !b.Plus {
b.mh = matterhook.New(b.Config.Mattermost.URL,
matterhook.Config{InsecureSkipVerify: b.Config.Mattermost.SkipTLSVerify,
@@ -67,7 +75,7 @@ func New(cfg *config.Config, c chan config.Message) *Bmattermost {
flog.mm.Infof("Trying login %s (team: %s) on %s", b.Config.Mattermost.Login, b.Config.Mattermost.Team, b.Config.Mattermost.Server)
err := b.mc.Login()
if err != nil {
- flog.mm.Fatal("Can not connect", err)
+ return err
}
flog.mm.Info("Login ok")
b.mc.JoinChannel(b.Config.Mattermost.Channel)
@@ -77,11 +85,7 @@ func New(cfg *config.Config, c chan config.Message) *Bmattermost {
go b.mc.WsReceiver()
}
go b.handleMatter()
- return b
-}
-
-func (b *Bmattermost) Command(cmd string) string {
- return ""
+ return nil
}
func (b *Bmattermost) Name() string {