Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit b82ae2bf7546eccbf153036871b9b2656ada2e70 Author: Wim <wim@42.be> Date: Tue Jun 27 00:28:18 2017 +0000 Fix samechannel gateway issue. Closes #207 diff --git a/gateway/gateway.go b/gateway/gateway.go index 7d53069..be09ac7 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -56 +57 @@ 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" @@ -1816 +18217 @@ 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)   }