lib/irc: add CapRegistry

This commit is contained in:
Simon Ser 2021-12-10 15:34:51 +01:00
parent f6895fed32
commit 4cabae89ff
5 changed files with 90 additions and 59 deletions

View file

@ -322,10 +322,11 @@ export default {
execute: (app, args) => {
let newRealname = args.join(" ");
let client = getActiveClient(app);
if (!client.enabledCaps["setname"]) {
if (!client.caps.enabled.has("setname")) {
throw new Error("Server doesn't support changing the realname");
}
client.send({ command: "SETNAME", params: [newRealname] });
// TODO: save to local storage
},
},
"stats": {