Skip to content

Commit

Permalink
Keep whitespace-only messages from IRC by wrapping with ZWS
Browse files Browse the repository at this point in the history
  • Loading branch information
yutotakano authored and siniStar7 committed Sep 7, 2022
1 parent 8fde5fe commit 570866d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,12 @@ func (b *Bridge) loop() {

content := msg.Message

// No content = zero width space
if content == "" {
content = "\u200B"
// If the message contains content or only whitespace, surround that with
// zero width spaces so that Discord displays them as intended. E.g. 3
// space characters sent from IRC should render on Discord as 3 space
// characters too.
if strings.TrimSpace(content) == "" {
content = "\u200B" + content + "\u200B"
}

// Convert any emoji ye?
Expand Down

0 comments on commit 570866d

Please sign in to comment.