diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 0549187f..94a09186 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -234,7 +234,7 @@ func (b *Bdiscord) messageUpdate(s *discordgo.Session, m *discordgo.MessageUpdat // only when message is actually edited if m.Message.EditedTimestamp != "" { b.Log.Debugf("Sending edit message") - m.Content = m.Content + b.GetString("EditSuffix") + m.Content += b.GetString("EditSuffix") b.messageCreate(s, (*discordgo.MessageCreate)(m)) } } diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go index bfa7d827..dab2bb47 100644 --- a/bridge/helper/helper.go +++ b/bridge/helper/helper.go @@ -44,7 +44,7 @@ func SplitStringLength(input string, length int) string { a := []rune(input) str := "" for i, r := range a { - str = str + string(r) + str += string(r) if i > 0 && (i+1)%length == 0 { str += "\n" } diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 25f6beec..0702575b 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -63,8 +63,7 @@ func New(cfg *bridge.Config) bridge.Bridger { } func (b *Birc) Command(msg *config.Message) string { - switch msg.Text { - case "!users": + if msg.Text == "!users" { b.i.Handlers.Add(girc.RPL_NAMREPLY, b.storeNames) b.i.Handlers.Add(girc.RPL_ENDOFNAMES, b.endNames) b.i.Cmd.SendRaw("NAMES " + msg.Channel) @@ -237,7 +236,7 @@ func (b *Birc) Send(msg config.Message) (string, error) { } if len(b.Local) < b.MessageQueue { if len(b.Local) == b.MessageQueue-1 { - text = text + " " + text += " " } b.Local <- config.Message{Text: text, Username: msg.Username, Channel: msg.Channel, Event: msg.Event} } else { diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 18bc5572..aaf19326 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -234,11 +234,11 @@ func (b *Bmatrix) handleDownloadFile(rmsg *config.Message, content map[string]in if msgtype == "m.image" { mext, _ := mime.ExtensionsByType(mtype) if len(mext) > 0 { - name = name + mext[0] + name += mext[0] } } else { // just a default .png extension if we don't have mime info - name = name + ".png" + name += ".png" } } diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 93cc82f6..43d68edc 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -303,7 +303,7 @@ func (b *Btelegram) handleDownload(message *tgbotapi.Message, rmsg *config.Messa urlPart := strings.Split(url, "/") name = urlPart[len(urlPart)-1] if !strings.HasSuffix(name, ".webp") { - name = name + ".webp" + name += ".webp" } text = " " + url } @@ -338,7 +338,7 @@ func (b *Btelegram) handleDownload(message *tgbotapi.Message, rmsg *config.Messa name = urlPart[len(urlPart)-1] text = " " + url if !strings.HasSuffix(name, ".ogg") { - name = name + ".ogg" + name += ".ogg" } } if message.Audio != nil { @@ -356,7 +356,7 @@ func (b *Btelegram) handleDownload(message *tgbotapi.Message, rmsg *config.Messa // use the URL instead of native upload if b.GetBool("UseInsecureURL") { b.Log.Debugf("Setting message text to :%s", text) - rmsg.Text = rmsg.Text + text + rmsg.Text += text return nil } // if we have a file attached, download it (in memory) and put a pointer to it in msg.Extra diff --git a/gateway/gateway.go b/gateway/gateway.go index e699251f..d4c84650 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -481,7 +481,7 @@ func (gw *Gateway) handleFiles(msg *config.Message) { ext := filepath.Ext(fi.Name) fi.Name = fi.Name[0 : len(fi.Name)-len(ext)] fi.Name = reg.ReplaceAllString(fi.Name, "_") - fi.Name = fi.Name + ext + fi.Name += ext sha1sum := fmt.Sprintf("%x", sha1.Sum(*fi.Data))[:8]