From ee7d9c8fb896f1f7a3b979f2f6519ce983f25ee4 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 11 Oct 2018 14:02:42 +0800 Subject: [PATCH] Fixed attribution conditional logic. --- gateway/gateway.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gateway/gateway.go b/gateway/gateway.go index c89c49cf..bc9b9699 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -299,7 +299,12 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM Format: "html", }) - if resp[0].Source != channel.Options.Locale { + channelLang, err := language.Parse(channel.Options.Locale) + if err != nil { + flog.Error(err) + } + + if resp[0].Source != channelLang { // If the source language is the same as this channel, // just use the original text and don't add attribution text = resp[0].Text