diff options
author | Wim <wim@42.be> | 2019-02-17 21:49:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-17 21:49:45 +0100 |
commit | 0bcb0b882f8f49d9ae889165dc4478d1168e1f25 (patch) | |
tree | e9c23f4f07c46081e12f11e284ec5a39928138ab /gateway | |
parent | 4525fa31aa6ea595c93994b05a3a042965249100 (diff) | |
download | matterbridge-msglm-0bcb0b882f8f49d9ae889165dc4478d1168e1f25.tar.gz matterbridge-msglm-0bcb0b882f8f49d9ae889165dc4478d1168e1f25.tar.bz2 matterbridge-msglm-0bcb0b882f8f49d9ae889165dc4478d1168e1f25.zip |
Support join/leaves from discord. Closes #654 (#721)
Diffstat (limited to 'gateway')
-rw-r--r-- | gateway/gateway.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index 6ac0abe5..f74a6680 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -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 |