Fix CTCP ACTION: wrap in \x01 so /me + image shares render as '* nick …' in every client (mIRC etc.)
This commit is contained in:
parent
4f8d10c8a5
commit
b1b628bdc9
1 changed files with 3 additions and 1 deletions
|
|
@ -230,7 +230,9 @@ export class IrcClient {
|
||||||
}
|
}
|
||||||
action(target: string, text: string): void {
|
action(target: string, text: string): void {
|
||||||
// Proper CTCP ACTION (\x01ACTION …\x01); reserve 9 bytes for the wrapper.
|
// Proper CTCP ACTION (\x01ACTION …\x01); reserve 9 bytes for the wrapper.
|
||||||
for (const part of this.splitForLine('PRIVMSG', target, text, 9)) this.send(`PRIVMSG ${target} :ACTION ${part}`);
|
// Without the \x01 delimiters other clients (mIRC, …) show a literal "ACTION"
|
||||||
|
// in a normal line instead of rendering "* nick …".
|
||||||
|
for (const part of this.splitForLine('PRIVMSG', target, text, 9)) this.send(`PRIVMSG ${target} :\x01ACTION ${part}\x01`);
|
||||||
}
|
}
|
||||||
setNick(nick: string): void { this.send(`NICK ${nick}`); }
|
setNick(nick: string): void { this.send(`NICK ${nick}`); }
|
||||||
// User modes (global, per-user). Query with no modestring → RPL_UMODEIS (221).
|
// User modes (global, per-user). Query with no modestring → RPL_UMODEIS (221).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue