diff options
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | bridge/bridge.go | 6 | ||||
-rw-r--r-- | matterbridge.go | 14 |
3 files changed, 20 insertions, 12 deletions
@@ -8,9 +8,14 @@ Simple bridge between mattermost and IRC. This project has now [matterbridge-plus](https://github.com/42wim/matterbridge-plus/) merged in. Breaking changes for matterbridge can be found in [migration](https://github.com/42wim/matterbridge/blob/master/migration.md) +Look at [matterbridge.conf.sample] (https://github.com/42wim/matterbridge/blob/master/matterbridge.conf.sample) for an example. ## Requirements: -* [Mattermost] (https://github.com/mattermost/platform/) 3.x (stable, not a dev build) +* [Mattermost] (https://github.com/mattermost/platform/) +### Compatibility +* Matterbridge v0.6.0 (no binaries yet) works with mattermost 3.3.0 and higher [3.3.0 release](https://github.com/mattermost/platform/releases/tag/v3.3.0) +* Matterbridge v0.5.0 works with mattermost 3.0.0 - 3.2.0 [3.2.0 release](https://github.com/mattermost/platform/releases/tag/v3.2.0) + ### Webhooks version * Configured incoming/outgoing [webhooks](https://www.mattermost.org/webhooks/) on your mattermost instance. @@ -19,7 +24,8 @@ Breaking changes for matterbridge can be found in [migration](https://github.com * A dedicated user(bot) on your mattermost instance. ## binaries -Binaries can be found [here] (https://github.com/42wim/matterbridge/releases/tag/v0.5.0) +Binaries can be found [here] (https://github.com/42wim/matterbridge/releases/) +* For use with mattermost 3.0.0-3.2.0 [v0.5.0](https://github.com/42wim/matterircd/releases/tag/v0.5.0) ## building Go 1.6+ is required. Make sure you have [Go](https://golang.org/doc/install) properly installed, including setting up your [GOPATH] (https://golang.org/doc/code.html#GOPATH) @@ -48,7 +54,7 @@ Usage of ./matterbridge: -debug enable debug -plus - running using API instead of webhooks + running using API instead of webhooks (deprecated, set Plus flag in [general] config) -version show version ``` diff --git a/bridge/bridge.go b/bridge/bridge.go index 898014e7..8fe233d6 100644 --- a/bridge/bridge.go +++ b/bridge/bridge.go @@ -41,7 +41,7 @@ func initFLog() { flog.xmpp = log.WithFields(log.Fields{"module": "xmpp"}) } -func NewBridge(name string, cfg *config.Config, kind string) *Bridge { +func NewBridge(cfg *config.Config) error { c := make(chan config.Message) initFLog() b := &Bridge{} @@ -57,8 +57,8 @@ func NewBridge(name string, cfg *config.Config, kind string) *Bridge { } b.mapChannels() b.mapIgnores() - go b.handleReceive(c) - return b + b.handleReceive(c) + return nil } func (b *Bridge) handleReceive(c chan config.Message) { diff --git a/matterbridge.go b/matterbridge.go index 689a08df..58916a65 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -8,7 +8,7 @@ import ( log "github.com/Sirupsen/logrus" ) -var version = "0.5.0-beta2" +var version = "0.6.0-dev" func init() { log.SetFormatter(&log.TextFormatter{FullTimestamp: true}) @@ -18,7 +18,7 @@ func main() { flagConfig := flag.String("conf", "matterbridge.conf", "config file") flagDebug := flag.Bool("debug", false, "enable debug") flagVersion := flag.Bool("version", false, "show version") - flagPlus := flag.Bool("plus", false, "running using API instead of webhooks") + flagPlus := flag.Bool("plus", false, "running using API instead of webhooks (deprecated, set Plus flag in [general] config)") flag.Parse() if *flagVersion { fmt.Println("version:", version) @@ -30,10 +30,12 @@ func main() { log.SetLevel(log.DebugLevel) } fmt.Println("running version", version) + cfg := config.NewConfig(*flagConfig) if *flagPlus { - bridge.NewBridge("matterbot", config.NewConfig(*flagConfig), "") - } else { - bridge.NewBridge("matterbot", config.NewConfig(*flagConfig), "legacy") + cfg.General.Plus = true + } + err := bridge.NewBridge(cfg) + if err != nil { + log.Debugf("starting bridge failed %#v", err) } - select {} } |