diff options
author | Jair Sanchez <78786202+jx11r@users.noreply.github.com> | 2022-11-26 16:53:48 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-26 23:53:48 +0100 |
commit | 3ad5deaff12abdba195824a940ab053ad6630752 (patch) | |
tree | 0effbbd69c844cdec2097eccc0c5acf29676ee53 | |
parent | 9bbdf70e69182c9677152bc69109a5992700192e (diff) | |
download | matterbridge-msglm-3ad5deaff12abdba195824a940ab053ad6630752.tar.gz matterbridge-msglm-3ad5deaff12abdba195824a940ab053ad6630752.tar.bz2 matterbridge-msglm-3ad5deaff12abdba195824a940ab053ad6630752.zip |
Fix empty messages on IRC (#1897)
-rw-r--r-- | bridge/helper/helper.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go index fb65d8d9..0208dff1 100644 --- a/bridge/helper/helper.go +++ b/bridge/helper/helper.go @@ -86,6 +86,12 @@ func GetSubLines(message string, maxLineLength int, clippingMessage string) []st var lines []string for _, line := range strings.Split(strings.TrimSpace(message), "\n") { + if line == "" { + // Prevent sending empty messages, so we'll skip this line + // if it has no content. + continue + } + if maxLineLength == 0 || len([]byte(line)) <= maxLineLength { lines = append(lines, line) continue |