summaryrefslogtreecommitdiffstats
path: root/bridge/mumble/mumble.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/mumble/mumble.go')
-rw-r--r--bridge/mumble/mumble.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/bridge/mumble/mumble.go b/bridge/mumble/mumble.go
index 945cf559..859ca4ab 100644
--- a/bridge/mumble/mumble.go
+++ b/bridge/mumble/mumble.go
@@ -250,7 +250,12 @@ func (b *Bmumble) processMessage(msg *config.Message) {
// If there is a maximum message length, split and truncate the lines
var msgLines []string
if maxLength := b.serverConfig.MaximumMessageLength; maxLength != nil {
- msgLines = helper.GetSubLines(msg.Text, *maxLength-len(msg.Username), b.GetString("MessageClipped"))
+ if *maxLength != 0 { // Some servers will have unlimited message lengths.
+ // Not doing this makes underflows happen.
+ msgLines = helper.GetSubLines(msg.Text, *maxLength-len(msg.Username), b.GetString("MessageClipped"))
+ } else {
+ msgLines = helper.GetSubLines(msg.Text, 0, b.GetString("MessageClipped"))
+ }
} else {
msgLines = helper.GetSubLines(msg.Text, 0, b.GetString("MessageClipped"))
}