Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 31ba8d2a25d3ca3f61d6f0e58592663bdaee531e Author: Wim <wim@42.be> Date: Mon Aug 15 21:11:50 2016 +0000 Add documentation about breaking API changes for mattermost 3.3.0. Start work on 0.6.0-dev diff --git a/README.md b/README.md index 2b5eac0..5de682a 100644 --- a/README.md +++ b/README.md @@ -89 +814 @@ 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. @@ -197 +248 @@ 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) @@ -487 +547 @@ 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 898014e..8fe233d 100644 --- a/bridge/bridge.go +++ b/bridge/bridge.go @@ -417 +417 @@ 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{} @@ -578 +578 @@ 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 689a08d..58916a6 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -87 +87 @@ 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}) @@ -187 +187 @@ 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) @@ -3010 +3012 @@ 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 {}  }