From 87229bab13d89d87284993f27a4c5c2afa762aa2 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 24 May 2017 22:10:21 +0200 Subject: Fix sending to different channels on same account (slack). Closes #177 --- bridge/slack/slack.go | 3 --- gateway/gateway.go | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index cc03e9ed..eb08500c 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -89,9 +89,6 @@ func (b *Bslack) JoinChannel(channel string) error { func (b *Bslack) Send(msg config.Message) error { flog.Debugf("Receiving %#v", msg) - if msg.Account == b.Account { - return nil - } nick := msg.Username message := msg.Text channel := msg.Channel diff --git a/gateway/gateway.go b/gateway/gateway.go index b550430a..4cf4e0ec 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -192,9 +192,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) { return } originchannel := msg.Channel + origmsg := msg for _, channel := range gw.DestChannelFunc(&msg, *dest) { // do not send to ourself - if channel.ID == getChannelID(msg) { + if channel.ID == getChannelID(origmsg) { continue } log.Debugf("Sending %#v from %s (%s) to %s (%s)", msg, msg.Account, originchannel, dest.Account, channel.Name) -- cgit v1.2.3