5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 14:00:27 +00:00

Add documentation about breaking API changes for mattermost 3.3.0. Start work on 0.6.0-dev

This commit is contained in:
Wim 2016-08-15 21:11:50 +02:00
parent 32e5f396e7
commit 96e21dd051
3 changed files with 20 additions and 12 deletions

View File

@ -8,9 +8,14 @@ Simple bridge between mattermost and IRC.
This project has now [matterbridge-plus](https://github.com/42wim/matterbridge-plus/) merged in. 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) 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: ## 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 ### Webhooks version
* Configured incoming/outgoing [webhooks](https://www.mattermost.org/webhooks/) on your mattermost instance. * 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. * A dedicated user(bot) on your mattermost instance.
## binaries ## 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 ## 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) 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 -debug
enable debug enable debug
-plus -plus
running using API instead of webhooks running using API instead of webhooks (deprecated, set Plus flag in [general] config)
-version -version
show version show version
``` ```

View File

@ -41,7 +41,7 @@ func initFLog() {
flog.xmpp = log.WithFields(log.Fields{"module": "xmpp"}) 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) c := make(chan config.Message)
initFLog() initFLog()
b := &Bridge{} b := &Bridge{}
@ -57,8 +57,8 @@ func NewBridge(name string, cfg *config.Config, kind string) *Bridge {
} }
b.mapChannels() b.mapChannels()
b.mapIgnores() b.mapIgnores()
go b.handleReceive(c) b.handleReceive(c)
return b return nil
} }
func (b *Bridge) handleReceive(c chan config.Message) { func (b *Bridge) handleReceive(c chan config.Message) {

View File

@ -8,7 +8,7 @@ import (
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
) )
var version = "0.5.0-beta2" var version = "0.6.0-dev"
func init() { func init() {
log.SetFormatter(&log.TextFormatter{FullTimestamp: true}) log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
@ -18,7 +18,7 @@ func main() {
flagConfig := flag.String("conf", "matterbridge.conf", "config file") flagConfig := flag.String("conf", "matterbridge.conf", "config file")
flagDebug := flag.Bool("debug", false, "enable debug") flagDebug := flag.Bool("debug", false, "enable debug")
flagVersion := flag.Bool("version", false, "show version") 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() flag.Parse()
if *flagVersion { if *flagVersion {
fmt.Println("version:", version) fmt.Println("version:", version)
@ -30,10 +30,12 @@ func main() {
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
} }
fmt.Println("running version", version) fmt.Println("running version", version)
cfg := config.NewConfig(*flagConfig)
if *flagPlus { if *flagPlus {
bridge.NewBridge("matterbot", config.NewConfig(*flagConfig), "") cfg.General.Plus = true
} else { }
bridge.NewBridge("matterbot", config.NewConfig(*flagConfig), "legacy") err := bridge.NewBridge(cfg)
if err != nil {
log.Debugf("starting bridge failed %#v", err)
} }
select {}
} }