4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 01:49:22 +00:00

Support join/leaves from discord. Closes #654 (#721)

This commit is contained in:
Wim
2019-02-17 21:49:45 +01:00
committed by GitHub
parent 4525fa31aa
commit 0bcb0b882f
3 changed files with 56 additions and 0 deletions

View File

@ -174,6 +174,18 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con
return channels
}
// discord join/leave is for the whole bridge, isn't a per channel join/leave
if msg.Event == config.EventJoinLeave && dest.Protocol == "discord" && msg.Account == dest.Account {
flog.Error("here")
for _, channel := range gw.Channels {
if channel.Account == msg.Account && strings.Contains(channel.Direction, "out") &&
gw.validGatewayDest(msg) {
channels = append(channels, *channel)
}
}
return channels
}
// if source channel is in only, do nothing
for _, channel := range gw.Channels {
// lookup the channel from the message