Skip to content

Commit 1b1a9ce

Browse files
committed
Fix samechannel gateway issue. Closes #207
1 parent 25ac4c7 commit 1b1a9ce

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

gateway/gateway.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/42wim/matterbridge/bridge"
66
"github.com/42wim/matterbridge/bridge/config"
77
log "github.com/Sirupsen/logrus"
8+
// "github.com/davecgh/go-spew/spew"
89
"regexp"
910
"strings"
1011
"time"
@@ -181,6 +182,17 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con
181182
if _, ok := gw.Channels[getChannelID(*msg)]; !ok {
182183
continue
183184
}
185+
// add gateway to message
186+
gw.validGatewayDest(msg, channel)
187+
188+
// do samechannelgateway logic
189+
if channel.SameChannel[msg.Gateway] {
190+
if msg.Channel == channel.Name && msg.Account != dest.Account {
191+
channels = append(channels, *channel)
192+
}
193+
continue
194+
}
195+
184196
if channel.Direction == "out" && channel.Account == dest.Account && gw.validGatewayDest(msg, channel) {
185197
channels = append(channels, *channel)
186198
}

0 commit comments

Comments
 (0)