Skip to content

Commit 0e6be40

Browse files
committed
fix(irc): preserve boundary word splitting
1 parent 060f4a4 commit 0e6be40

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

extensions/irc/src/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function takeIrcPrivmsgChunk(text: string, maxChars: number, maxBytes: number):
3333
return text;
3434
}
3535
const fitted = text.slice(0, end);
36+
// A delimiter just beyond the cap already gives this chunk a clean word boundary.
37+
if (text[end] === " ") {
38+
return fitted;
39+
}
3640
const splitAt = fitted.lastIndexOf(" ");
3741
if (splitAt >= Math.floor(fitted.length / 2)) {
3842
return fitted.slice(0, splitAt);

0 commit comments

Comments
 (0)