forked from lug/matterbridge
		
	Compare commits
	
		
			7 Commits
		
	
	
		
			v1.14.0-rc
			...
			v0.7.1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					d9ff0b72fa | ||
| 
						 | 
					8c83eb03c7 | ||
| 
						 | 
					e28649b592 | ||
| 
						 | 
					e4e822ef6a | ||
| 
						 | 
					69d6f4b2da | ||
| 
						 | 
					f7e22983a5 | ||
| 
						 | 
					cac9fb838c | 
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							@@ -1,8 +1,4 @@
 | 
			
		||||
# matterbridge
 | 
			
		||||
 | 
			
		||||
:warning: Look at [README-0.6.md] (https://github.com/42wim/matterbridge/blob/master/README-0.6.md) for the documentation of the current stable. 
 | 
			
		||||
The information below is about the develop version.
 | 
			
		||||
 | 
			
		||||
Simple bridge between mattermost, IRC, XMPP, Gitter, Slack and Discord
 | 
			
		||||
 | 
			
		||||
* Relays public channel messages between multiple mattermost, IRC, XMPP, Gitter, Slack and Discord. Pick and mix.
 | 
			
		||||
@@ -15,7 +11,7 @@ Look at [matterbridge.toml.sample] (https://github.com/42wim/matterbridge/blob/m
 | 
			
		||||
Look at [matterbridge.toml.simple] (https://github.com/42wim/matterbridge/blob/master/matterbridge.toml.simple) for a simple example.
 | 
			
		||||
 | 
			
		||||
## Changelog
 | 
			
		||||
Since v0.7.0-dev the configuration has changed. More details in [changelog.md] (https://github.com/42wim/matterbridge/blob/master/changelog.md)
 | 
			
		||||
Since v0.7.0 the configuration has changed. More details in [changelog.md] (https://github.com/42wim/matterbridge/blob/master/changelog.md)
 | 
			
		||||
 | 
			
		||||
## Requirements
 | 
			
		||||
Accounts to one of the supported bridges
 | 
			
		||||
@@ -34,12 +30,14 @@ 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.3.0+ [v0.6.1](https://github.com/42wim/matterircd/releases/tag/v0.6.1)
 | 
			
		||||
* For use with mattermost 3.0.0-3.2.0 [v0.5.0](https://github.com/42wim/matterircd/releases/tag/v0.5.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.6.1 works with mattermost 3.3.0 and higher [3.3.0 release](https://github.com/mattermost/platform/releases/tag/v3.3.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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								changelog.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								changelog.md
									
									
									
									
									
								
							@@ -1,4 +1,19 @@
 | 
			
		||||
# v0.7-dev
 | 
			
		||||
# 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.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.7.0-dev"
 | 
			
		||||
var version = "0.7.1"
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user