Handle RPL_WELCOME

This commit is contained in:
Simon Ser 2020-06-06 10:06:07 +02:00
parent 8b35d40702
commit a8e876843b
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 6 additions and 3 deletions

View file

@ -181,9 +181,6 @@ function connect() {
ws.onopen = function() {
console.log("Connection opened");
// TODO: wait for RPL_WELCOME
connectElt.style.display = "none";
if (server.pass) {
ws.send(formatMessage({ command: "PASS", params: [server.pass] }));
}
@ -199,6 +196,10 @@ function connect() {
console.log(msg);
switch (msg.command) {
case RPL_WELCOME:
console.log("Registration complete");
connectElt.style.display = "none";
break;
case "NOTICE":
case "PRIVMSG":
var target = msg.params[0];

View file

@ -1,3 +1,5 @@
const RPL_WELCOME = "001";
function parsePrefix(s) {
var prefix = {
name: null,