mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 20:09:24 +00:00
Compare commits
7 Commits
v0.16.0-rc
...
v0.8.1
Author | SHA1 | Date | |
---|---|---|---|
681e9bd269 | |||
b3c11b584f | |||
07a560b2f5 | |||
02bd136040 | |||
2d1316e32c | |||
11def2edc0 | |||
65bffb8735 |
@ -30,17 +30,16 @@ docker run -ti -v /tmp/matterbridge.toml:/matterbridge.toml 42wim/matterbridge
|
||||
|
||||
## binaries
|
||||
Binaries can be found [here] (https://github.com/42wim/matterbridge/releases/)
|
||||
* For use with mattermost 3.5.0+ [v0.8.0](https://github.com/42wim/matterircd/releases/tag/v0.8.0)
|
||||
* For use with mattermost 3.3.0 - 3.4.0 [v0.7.0](https://github.com/42wim/matterircd/releases/tag/v0.7.0)
|
||||
* For use with mattermost 3.5.0+ [v0.8.1](https://github.com/42wim/matterircd/releases/tag/v0.8.1)
|
||||
* For use with mattermost 3.3.0 - 3.4.0 [v0.7.1](https://github.com/42wim/matterircd/releases/tag/v0.7.1)
|
||||
* For use with mattermost 3.0.0 - 3.2.0 [v0.5.0](https://github.com/42wim/matterircd/releases/tag/v0.5.0) (not maintained anymore)
|
||||
|
||||
## Compatibility
|
||||
### Mattermost
|
||||
* Matterbridge v0.8.0 works with mattermost 3.5.0+ [3.5.0 release](https://github.com/mattermost/platform/releases/tag/v3.5.0)
|
||||
* Matterbridge v0.7.0 works with mattermost 3.3.0 - 3.4.0 [3.4.0 release](https://github.com/mattermost/platform/releases/tag/v3.4.0)
|
||||
* Matterbridge v0.8.1 works with mattermost 3.5.0+ [3.5.0 release](https://github.com/mattermost/platform/releases/tag/v3.5.0)
|
||||
* Matterbridge v0.7.1 works with mattermost 3.3.0 - 3.4.0 [3.4.0 release](https://github.com/mattermost/platform/releases/tag/v3.4.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.
|
||||
|
||||
|
@ -55,9 +55,9 @@ func New(cfg config.Protocol, origin string, c chan config.Message) *Birc {
|
||||
func (b *Birc) Command(msg *config.Message) string {
|
||||
switch msg.Text {
|
||||
case "!users":
|
||||
b.i.AddCallback(ircm.RPL_NAMREPLY, b.storeNames)
|
||||
b.i.AddCallback(ircm.RPL_ENDOFNAMES, b.endNames)
|
||||
b.i.SendRaw("NAMES " + msg.Channel)
|
||||
b.i.ClearCallback(ircm.RPL_ENDOFNAMES)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@ -160,6 +160,8 @@ func (b *Birc) endNames(event *irc.Event) {
|
||||
b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel], continued), Channel: channel,
|
||||
Origin: b.origin, Protocol: b.protocol, FullOrigin: b.FullOrigin()}
|
||||
b.names[channel] = nil
|
||||
b.i.ClearCallback(ircm.RPL_NAMREPLY)
|
||||
b.i.ClearCallback(ircm.RPL_ENDOFNAMES)
|
||||
}
|
||||
|
||||
func (b *Birc) handleNewConnection(event *irc.Event) {
|
||||
@ -169,7 +171,6 @@ func (b *Birc) handleNewConnection(event *irc.Event) {
|
||||
i.AddCallback("PRIVMSG", b.handlePrivMsg)
|
||||
i.AddCallback("CTCP_ACTION", b.handlePrivMsg)
|
||||
i.AddCallback(ircm.RPL_TOPICWHOTIME, b.handleTopicWhoTime)
|
||||
i.AddCallback(ircm.RPL_NAMREPLY, b.storeNames)
|
||||
i.AddCallback(ircm.NOTICE, b.handleNotice)
|
||||
//i.AddCallback(ircm.RPL_MYINFO, func(e *irc.Event) { flog.Infof("%s: %s", e.Code, strings.Join(e.Arguments[1:], " ")) })
|
||||
i.AddCallback("PING", func(e *irc.Event) {
|
||||
|
14
changelog.md
14
changelog.md
@ -1,9 +1,19 @@
|
||||
# v0.8
|
||||
# v0.8.1
|
||||
## Bugfix
|
||||
* general: when using samechannelgateway NickFormat get doubled by the NICK #77
|
||||
* irc: fix !users command #78
|
||||
|
||||
# v0.8.0
|
||||
Release because of breaking mattermost API changes
|
||||
## New features
|
||||
* Supports mattermost v3.5.0
|
||||
|
||||
# v0.7
|
||||
# v0.7.1
|
||||
## Bugfix
|
||||
* general: when using samechannelgateway NickFormat get doubled by the NICK #77
|
||||
* irc: fix !users command #78
|
||||
|
||||
# v0.7.0
|
||||
## Breaking config changes from 0.6 to 0.7
|
||||
Matterbridge now uses TOML configuration (https://github.com/toml-lang/toml)
|
||||
See matterbridge.toml.sample for an example
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"github.com/42wim/matterbridge/bridge"
|
||||
"github.com/42wim/matterbridge/bridge/config"
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type SameChannelGateway struct {
|
||||
@ -62,7 +61,6 @@ func (gw *SameChannelGateway) handleMessage(msg config.Message, dest bridge.Brid
|
||||
if msg.FullOrigin == dest.FullOrigin() {
|
||||
return
|
||||
}
|
||||
gw.modifyMessage(&msg, dest)
|
||||
log.Debugf("Sending %#v from %s (%s) to %s (%s)", msg, msg.FullOrigin, msg.Channel, dest.FullOrigin(), msg.Channel)
|
||||
err := dest.Send(msg)
|
||||
if err != nil {
|
||||
@ -70,29 +68,6 @@ func (gw *SameChannelGateway) handleMessage(msg config.Message, dest bridge.Brid
|
||||
}
|
||||
}
|
||||
|
||||
func setNickFormat(msg *config.Message, format string) {
|
||||
if format == "" {
|
||||
msg.Username = msg.Protocol + "." + msg.Origin + "-" + msg.Username + ": "
|
||||
return
|
||||
}
|
||||
msg.Username = strings.Replace(format, "{NICK}", msg.Username, -1)
|
||||
msg.Username = strings.Replace(msg.Username, "{BRIDGE}", msg.Origin, -1)
|
||||
msg.Username = strings.Replace(msg.Username, "{PROTOCOL}", msg.Protocol, -1)
|
||||
}
|
||||
|
||||
func (gw *SameChannelGateway) modifyMessage(msg *config.Message, dest bridge.Bridge) {
|
||||
switch dest.Protocol() {
|
||||
case "irc":
|
||||
setNickFormat(msg, gw.Config.IRC[dest.Origin()].RemoteNickFormat)
|
||||
case "mattermost":
|
||||
setNickFormat(msg, gw.Config.Mattermost[dest.Origin()].RemoteNickFormat)
|
||||
case "slack":
|
||||
setNickFormat(msg, gw.Config.Slack[dest.Origin()].RemoteNickFormat)
|
||||
case "discord":
|
||||
setNickFormat(msg, gw.Config.Discord[dest.Origin()].RemoteNickFormat)
|
||||
}
|
||||
}
|
||||
|
||||
func (gw *SameChannelGateway) validChannel(channel string) bool {
|
||||
for _, c := range gw.Channels {
|
||||
if c == channel {
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
log "github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
var version = "0.9.0-dev"
|
||||
var version = "0.8.1"
|
||||
|
||||
func init() {
|
||||
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
|
||||
|
Reference in New Issue
Block a user