mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-24 21:21:34 +00:00
Split on UTF-8 for MessageSplit (irc). Closes #308
This commit is contained in:
parent
1de64f3f61
commit
c447647af9
@ -197,8 +197,9 @@ func (b *Birc) Send(msg config.Message) (string, error) {
|
|||||||
msg.Text = helper.SplitStringLength(msg.Text, b.Config.MessageLength)
|
msg.Text = helper.SplitStringLength(msg.Text, b.Config.MessageLength)
|
||||||
}
|
}
|
||||||
for _, text := range strings.Split(msg.Text, "\n") {
|
for _, text := range strings.Split(msg.Text, "\n") {
|
||||||
|
input := []rune(text)
|
||||||
if len(text) > b.Config.MessageLength {
|
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 {
|
||||||
if len(b.Local) == b.Config.MessageQueue-1 {
|
if len(b.Local) == b.Config.MessageQueue-1 {
|
||||||
|
Loading…
Reference in New Issue
Block a user