mirror of
https://github.com/thelounge/thelounge
synced 2024-11-28 15:00:37 +00:00
b7540b5827
This decouples the rest of the server from the client
18 lines
375 B
TypeScript
18 lines
375 B
TypeScript
const matchFormatting =
|
|
/\x02|\x1D|\x1F|\x16|\x0F|\x11|\x1E|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
|
|
|
|
export function cleanIrcMessage(message: string) {
|
|
return message.replace(matchFormatting, "").trim();
|
|
}
|
|
|
|
export const condensedTypes = new Set([
|
|
"away",
|
|
"back",
|
|
"chghost",
|
|
"join",
|
|
"kick",
|
|
"mode",
|
|
"nick",
|
|
"part",
|
|
"quit",
|
|
]);
|