mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-28 11:31:34 +00:00
Revert "Fix typo" This reverts commitdffd67eb31
. Revert "Handle quit message relay better on gateways with one channel on the irc bridge #722" This reverts commit240559581a
. Revert "Support quits from irc correctly. Fixes #722 (#724)" This reverts commitd76a04bd0a
.
This commit is contained in:
parent
60a85621ea
commit
8a875f292e
@ -92,10 +92,6 @@ func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
b.Log.Debugf("<= Sending JOIN_LEAVE event from %s to gateway", b.Account)
|
b.Log.Debugf("<= Sending JOIN_LEAVE event from %s to gateway", b.Account)
|
||||||
// QUIT isn't channel bound, happens for all channels on the bridge
|
|
||||||
if event.Command == "QUIT" {
|
|
||||||
channel = ""
|
|
||||||
}
|
|
||||||
msg := config.Message{Username: "system", Text: event.Source.Name + " " + strings.ToLower(event.Command) + "s", Channel: channel, Account: b.Account, Event: config.EventJoinLeave}
|
msg := config.Message{Username: "system", Text: event.Source.Name + " " + strings.ToLower(event.Command) + "s", Channel: channel, Account: b.Account, Event: config.EventJoinLeave}
|
||||||
b.Log.Debugf("<= Message is %#v", msg)
|
b.Log.Debugf("<= Message is %#v", msg)
|
||||||
b.Remote <- msg
|
b.Remote <- msg
|
||||||
|
@ -212,23 +212,6 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con
|
|||||||
return channels
|
return channels
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 dest.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) {
|
|
||||||
channels = append(channels, *channel)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return channels
|
|
||||||
}
|
|
||||||
|
|
||||||
// if source channel is in only, do nothing
|
// if source channel is in only, do nothing
|
||||||
for _, channel := range gw.Channels {
|
for _, channel := range gw.Channels {
|
||||||
// lookup the channel from the message
|
// lookup the channel from the message
|
||||||
|
Loading…
Reference in New Issue
Block a user