From 12989bbd99768facafe5d77dec98ff2908502499 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 30 Jul 2017 16:09:05 +0200 Subject: Handle same account in multiple gateways better --- gateway/gateway.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gateway/gateway.go') diff --git a/gateway/gateway.go b/gateway/gateway.go index dfd0604a..86fa5723 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -170,7 +170,8 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) { } func (gw *Gateway) ignoreMessage(msg *config.Message) bool { - if gw.Router.getGatewayName(getChannelID(*msg)) != gw.Name { + // if we don't have the bridge, ignore it + if _, ok := gw.Bridges[msg.Account]; !ok { return true } if msg.Text == "" { @@ -240,7 +241,7 @@ func (gw *Gateway) modifyAvatar(msg config.Message, dest *bridge.Bridge) string func (gw *Gateway) modifyMessage(msg *config.Message) { // replace :emoji: to unicode msg.Text = emojilib.Replace(msg.Text) - msg.Gateway = gw.Router.getGatewayName(getChannelID(*msg)) + msg.Gateway = gw.Name } func getChannelID(msg config.Message) string { -- cgit v1.2.3