Sync with upstream

This commit is contained in:
Gello
2019-06-14 07:47:39 +03:00
6 changed files with 50 additions and 6 deletions

View File

@@ -129,7 +129,7 @@ See https://github.com/42wim/matterbridge/wiki
## Installing
### Binaries
* Latest stable release [v1.14.4](https://github.com/42wim/matterbridge/releases/latest)
* Latest stable release [v1.15.0](https://github.com/42wim/matterbridge/releases/latest)
* Development releases (follows master) can be downloaded [here](https://dl.bintray.com/42wim/nightly/)
### Packages

View File

@@ -13,7 +13,9 @@ type BLegacy struct {
}
func NewLegacy(cfg *bridge.Config) bridge.Bridger {
return &BLegacy{Bslack: newBridge(cfg)}
b := &BLegacy{Bslack: newBridge(cfg)}
b.legacy = true
return b
}
func (b *BLegacy) Connect() error {

View File

@@ -32,6 +32,7 @@ type Bslack struct {
channels *channels
users *users
legacy bool
}
const (
@@ -151,6 +152,18 @@ func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
return nil
}
// try to join a channel when in legacy
if b.legacy {
_, err := b.sc.JoinChannel(channel.Name)
if err != nil {
switch err.Error() {
case "name_taken", "restricted_action":
case "default":
return err
}
}
}
b.channels.populateChannels(false)
channelInfo, err := b.channels.getChannel(channel.Name)
@@ -163,7 +176,8 @@ func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
channel.Name = channelInfo.Name
}
if !channelInfo.IsMember {
// we can't join a channel unless we are using legacy tokens #651
if !channelInfo.IsMember && !b.legacy {
return fmt.Errorf("slack integration that matterbridge is using is not member of channel '%s', please add it manually", channelInfo.Name)
}
return nil

View File

@@ -100,7 +100,7 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) {
func (b *Bxmpp) createXMPP() error {
tc := &tls.Config{
ServerName: strings.Split(b.GetString("Server"), ":")[0],
ServerName: strings.Split(b.GetString("Jid"), "@")[1],
InsecureSkipVerify: b.GetBool("SkipTLSVerify"), // nolint: gosec
}
options := xmpp.Options{
@@ -332,5 +332,5 @@ func (b *Bxmpp) skipMessage(message xmpp.Chat) bool {
}
// skip delayed messages
return !message.Stamp.IsZero() || time.Since(message.Stamp).Minutes() > 5
return !message.Stamp.IsZero() && time.Since(message.Stamp).Minutes() > 5
}

View File

@@ -1,3 +1,31 @@
# v1.15.0
## New features
* Add scripting (tengo) support for every outgoing message (#806)
See https://github.com/42wim/matterbridge/wiki/Settings#tengo and
https://github.com/42wim/matterbridge/wiki/Settings#outmessage for more information
* Add tengo support to RemoteNickFormat (#793)
See https://github.com/42wim/matterbridge/wiki/Settings#remotenickformat-2
* Deprecated `Message` under `[tengo]` to `InMessage`
## Enhancements
* general: Forward only user-typing messages if supported by protocol (#832)
* general: updated wiki with all possible settings: https://github.com/42wim/matterbridge/wiki/Settings
* tengo: Add msg event to tengo
* xmpp: Verify TLS against JID domain, not the host. (xmpp) (#834)
* xmpp: Allow messages with timestamp (xmpp). Fixes #835 (#847)
* irc: Add verbose IRC joins/parts (ident@host) (#805)
See https://github.com/42wim/matterbridge/wiki/Settings#verbosejoinpart
* rocketchat: Add useraction support (rocketchat). Closes #772 (#794)
## Bugfix
* slack: Fix regression in autojoining with legacy tokens (slack). Fixes #651 (#848)
* xmpp: Revert xmpp to orig behaviour. Closes #844
* whatsapp: Update github.com/Rhymen/go-whatsapp vendor. Fixes #843
* mattermost: Update channels of all teams (mattermost)
This release couldn't exist without the following contributors:
@42wim, @Helcaraxan, @chotaire, @qaisjp, @dajohi, @kousu
# v1.14.4
## Bugfix

View File

@@ -15,7 +15,7 @@ import (
)
var (
version = "1.15.0-dev"
version = "1.15.0"
githash string
flagConfig = flag.String("conf", "matterbridge.toml", "config file")