summaryrefslogtreecommitdiffstats
path: root/bridge/irc
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-12-07 22:21:54 +0100
committerWim <wim@42.be>2017-12-07 22:22:25 +0100
commitc447647af9cb8ce3d684a041772e8527613a99e0 (patch)
tree828516898801bc53da3ca88eec6dc833e283b785 /bridge/irc
parent1de64f3f61b7aa1cdd14e6e6a9c1c809b032cf4b (diff)
downloadmatterbridge-msglm-c447647af9cb8ce3d684a041772e8527613a99e0.tar.gz
matterbridge-msglm-c447647af9cb8ce3d684a041772e8527613a99e0.tar.bz2
matterbridge-msglm-c447647af9cb8ce3d684a041772e8527613a99e0.zip
Split on UTF-8 for MessageSplit (irc). Closes #308
Diffstat (limited to 'bridge/irc')
-rw-r--r--bridge/irc/irc.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go
index 0a24ec75..b493997a 100644
--- a/bridge/irc/irc.go
+++ b/bridge/irc/irc.go
@@ -197,8 +197,9 @@ 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 {