Handle self NICK messages

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

View file

@ -225,6 +225,13 @@ function connect() {
var channel = msg.params[0];
createBuffer(channel).addMessage(msg);
break;
case "NICK":
var newNick = msg.params[0];
if (msg.prefix.name == server.nick) {
server.nick = newNick;
}
// TODO: append message to all buffers the user is a member of
break;
default:
serverBuffer.addMessage(msg);
}

View file

@ -26,7 +26,7 @@
<form>
<h2>Connect to IRC</h2>
<label for="connect-url">URL:</label><br/>
<label for="connect-url">Server URL:</label><br/>
<input type="url" name="url" id="connect-url" value="ws://localhost:8080"/>
<br/><br/>