Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 4410014107ba1f1c3843db8b428b89da435d7df7 Author: Wim <wim@42.be> Date: Thu Dec 07 22:21:54 2017 +0000 Split on UTF-8 for MessageSplit (irc). Closes #308 diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 0a24ec7..b493997 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -1978 +1979 @@ func (b *Birc) Send(msg config.Message) (string, error) {   msg.Text = helper.SplitStringLength(msg.Text, b.Config.MessageLength)   }   for _, text := range strings.Split(msg.Text, "\n") { + input := []rune(text)   if len(text) > b.Config.MessageLength { - text = text[:b.Config.MessageLength] + " <message clipped>" + text = string(input[:b.Config.MessageLength]) + " <message clipped>"   }   if len(b.Local) < b.Config.MessageQueue {   if len(b.Local) == b.Config.MessageQueue-1 {