Auto-join when adding new network on irc:// link click

Closes: https://todo.sr.ht/~emersion/gamja/111
This commit is contained in:
Simon Ser
2021-11-07 19:47:49 +01:00
parent a58befd6d7
commit 74fe6ee944
3 changed files with 72 additions and 9 deletions

View File

@@ -861,4 +861,16 @@ export default class Client extends EventTarget {
this.send({ command: "MONITOR", params: ["-", target] });
}
createBouncerNetwork(attrs) {
let msg = {
command: "BOUNCER",
params: ["ADDNETWORK", irc.formatTags(attrs)],
};
return this.roundtrip(msg, (msg) => {
if (msg.command === "BOUNCER" && msg.params[0] === "ADDNETWORK") {
return msg.params[1];
}
});
}
}