summaryrefslogtreecommitdiffstats
path: root/bridge/helper
diff options
context:
space:
mode:
authorJair Sanchez <78786202+jx11r@users.noreply.github.com>2022-11-26 16:53:48 -0600
committerGitHub <noreply@github.com>2022-11-26 23:53:48 +0100
commit3ad5deaff12abdba195824a940ab053ad6630752 (patch)
tree0effbbd69c844cdec2097eccc0c5acf29676ee53 /bridge/helper
parent9bbdf70e69182c9677152bc69109a5992700192e (diff)
downloadmatterbridge-msglm-3ad5deaff12abdba195824a940ab053ad6630752.tar.gz
matterbridge-msglm-3ad5deaff12abdba195824a940ab053ad6630752.tar.bz2
matterbridge-msglm-3ad5deaff12abdba195824a940ab053ad6630752.zip
Fix empty messages on IRC (#1897)
Diffstat (limited to 'bridge/helper')
-rw-r--r--bridge/helper/helper.go6
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