Skip to content

Commit

Permalink
Fix empty messages on IRC
Browse files Browse the repository at this point in the history
  • Loading branch information
jx11r committed Sep 24, 2022
1 parent 0c83946 commit b307375
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bridge/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b307375

Please # to comment.