Add support for RPL_ISUPPORT
This commit is contained in:
parent
4acacc1f22
commit
b3f8b0c97d
2 changed files with 28 additions and 0 deletions
19
lib/irc.js
19
lib/irc.js
|
@ -3,6 +3,7 @@ export const RPL_WELCOME = "001";
|
|||
export const RPL_YOURHOST = "002";
|
||||
export const RPL_CREATED = "003";
|
||||
export const RPL_MYINFO = "004";
|
||||
export const RPL_ISUPPORT = "005";
|
||||
export const RPL_ENDOFWHO = "315";
|
||||
export const RPL_NOTOPIC = "331";
|
||||
export const RPL_TOPIC = "332";
|
||||
|
@ -313,3 +314,21 @@ export function parseCTCP(msg) {
|
|||
ctcp.command = ctcp.command.toUpperCase();
|
||||
return ctcp;
|
||||
}
|
||||
|
||||
export function parseISUPPORT(tokens, params) {
|
||||
tokens.forEach((tok) => {
|
||||
if (tok.startsWith("-")) {
|
||||
var k = tok.slice(1);
|
||||
params.delete(k.toUpperCase());
|
||||
return;
|
||||
}
|
||||
|
||||
var i = tok.indexOf("=");
|
||||
var k = tok, v = "";
|
||||
if (i >= 0) {
|
||||
k = tok.slice(0, i);
|
||||
v = tok.slice(i + 1);
|
||||
}
|
||||
params.set(k.toUpperCase(), v);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue