From 449ed31e25f2c21ac9db258999a5a893889983eb Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 14 Nov 2016 22:53:06 +0100 Subject: Fix ShowJoinPart from irc bridge. Closes #72 --- gateway/gateway.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gateway') diff --git a/gateway/gateway.go b/gateway/gateway.go index 580e129d..63da4bba 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -106,6 +106,10 @@ func (gw *Gateway) mapIgnores() { func (gw *Gateway) getDestChannel(msg *config.Message, dest string) []string { channels := gw.ChannelsIn[msg.Account] + // broadcast to every out channel (irc QUIT) + if msg.Event == config.EVENT_JOIN_LEAVE && msg.Channel == "" { + return gw.ChannelsOut[dest] + } for _, channel := range channels { if channel == msg.Channel { return gw.ChannelsOut[dest] @@ -118,6 +122,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) { if gw.ignoreMessage(&msg) { return } + // only relay join/part when configged + if msg.Event == config.EVENT_JOIN_LEAVE && !gw.Bridges[dest.Account].Config.ShowJoinPart { + return + } originchannel := msg.Channel channels := gw.getDestChannel(&msg, dest.Account) for _, channel := range channels { -- cgit v1.2.3