4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-16 03:18:54 +00:00

Fix ShowJoinPart from irc bridge. Closes #72

This commit is contained in:
Wim
2016-11-14 22:53:06 +01:00
parent 1f36904588
commit 449ed31e25
5 changed files with 120 additions and 52 deletions

View File

@ -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 {