summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-02-21 17:52:28 +0100
committerWim <wim@42.be>2019-02-21 17:55:04 +0100
commit240559581a225ff632c00a52e029b3728c61309e (patch)
treed73bb853d0fc222a06e070921b85460024349348
parent48ba8294653da0c862295b2a6ff0709659fd6b69 (diff)
downloadmatterbridge-msglm-240559581a225ff632c00a52e029b3728c61309e.tar.gz
matterbridge-msglm-240559581a225ff632c00a52e029b3728c61309e.tar.bz2
matterbridge-msglm-240559581a225ff632c00a52e029b3728c61309e.zip
Handle quit message relay better on gateways with one channel on the irc bridge #722
-rw-r--r--gateway/gateway.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index eaffca11..36ef3ebe 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -188,6 +188,11 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con
// irc quit is for the whole bridge, isn't a per channel quit.
// channel is empty when we quit
if msg.Event == config.EventJoinLeave && getProtocol(msg) == "irc" && msg.Channel == "" {
+ // if we only have one channel on this irc bridge it's got to be the sending one.
+ // don't send it back
+ if channel.Account == msg.Account && len(dest.Channels) == 1 && dest.Protocol == "irc" {
+ return channels
+ }
for _, channel := range gw.Channels {
if channel.Account == dest.Account && strings.Contains(channel.Direction, "out") &&
gw.validGatewayDest(msg) {