Fixed attribution conditional logic.

This commit is contained in:
Patrick Connolly
2018-10-11 14:02:42 +08:00
parent f67b601900
commit ee7d9c8fb8

View File

@@ -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