summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-27 00:28:18 +0200
committerWim <wim@42.be>2017-06-27 00:28:18 +0200
commit1b1a9ce2503021c275a470c8da21d33bbdcf5681 (patch)
tree485d451ecf5cd6d6a49e8fc8cd976ade34149b94 /gateway
parent25ac4c708fcbc9fb157791be6b4e9887741754ec (diff)
downloadmatterbridge-msglm-1b1a9ce2503021c275a470c8da21d33bbdcf5681.tar.gz
matterbridge-msglm-1b1a9ce2503021c275a470c8da21d33bbdcf5681.tar.bz2
matterbridge-msglm-1b1a9ce2503021c275a470c8da21d33bbdcf5681.zip
Fix samechannel gateway issue. Closes #207
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index 7d53069c..be09ac76 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -5,6 +5,7 @@ import (
"github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config"
log "github.com/Sirupsen/logrus"
+ // "github.com/davecgh/go-spew/spew"
"regexp"
"strings"
"time"
@@ -181,6 +182,17 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con
if _, ok := gw.Channels[getChannelID(*msg)]; !ok {
continue
}
+ // add gateway to message
+ gw.validGatewayDest(msg, channel)
+
+ // do samechannelgateway logic
+ if channel.SameChannel[msg.Gateway] {
+ if msg.Channel == channel.Name && msg.Account != dest.Account {
+ channels = append(channels, *channel)
+ }
+ continue
+ }
+
if channel.Direction == "out" && channel.Account == dest.Account && gw.validGatewayDest(msg, channel) {
channels = append(channels, *channel)
}