summaryrefslogtreecommitdiffstats
path: root/bridge/irc/irc.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-12-07 22:21:54 +0100
committerWim <wim@42.be>2017-12-07 22:21:54 +0100
commit05eb75442ad3f68fe81b771e75c1842d96069ed7 (patch)
tree9ffefadf0a9ec266364b4b350306adf407ee7bd2 /bridge/irc/irc.go
parent3496ed0c7e294af6b6e5e0e01279a1763333be0c (diff)
downloadmatterbridge-msglm-05eb75442ad3f68fe81b771e75c1842d96069ed7.tar.gz
matterbridge-msglm-05eb75442ad3f68fe81b771e75c1842d96069ed7.tar.bz2
matterbridge-msglm-05eb75442ad3f68fe81b771e75c1842d96069ed7.zip
Split on UTF-8 for MessageSplit (irc). Closes #308
Diffstat (limited to 'bridge/irc/irc.go')
-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 {