Browse Source
Fix: Add server prefix to indicate server notices
feature/index.js
Sheogorath
6 years ago
No known key found for this signature in database
GPG Key ID: 1F05CC3635CDDFFD
3 changed files with
3 additions and
3 deletions
-
src/server.js
-
test/command_user.js
-
test/hexchat.js
|
|
@ -64,7 +64,7 @@ server.create = function create() { |
|
|
|
// ignoring servername and hostname, not useful these days
|
|
|
|
user.register(tokenized[1], tokenized[4]) |
|
|
|
let address = user.getAddress() |
|
|
|
socket.write(`001 ${user.nickname} :Welcome to the example IRC Project ${user.nickname}!~${user.username}@${address}\r\n`, "ascii") |
|
|
|
socket.write(`:irc.example.com 001 ${user.nickname} :Welcome to the example IRC Project ${user.nickname}!~${user.username}@${address}\r\n`, "ascii") |
|
|
|
break; |
|
|
|
case "PRIVMSG": |
|
|
|
let target = userlist[tokenized[1]] |
|
|
|
|
|
@ -10,7 +10,7 @@ describe("USER OK", function () { |
|
|
|
return { port: 12346, family: 'IPv4', address: '127.0.0.1' } |
|
|
|
} |
|
|
|
mockedSock.write = function (data) { |
|
|
|
assert.equal(data.toString("ascii"), "001 some_nick :Welcome to the example IRC Project some_nick!~guest@127.0.0.1\r\n") |
|
|
|
assert.equal(data.toString("ascii"), ":irc.example.com 001 some_nick :Welcome to the example IRC Project some_nick!~guest@127.0.0.1\r\n") |
|
|
|
done() |
|
|
|
} |
|
|
|
mockedSock.destroy = function () { |
|
|
|
|
|
@ -10,7 +10,7 @@ describe("hexchat", function () { |
|
|
|
return { port: 12346, family: 'IPv4', address: '127.0.0.1' } |
|
|
|
} |
|
|
|
mockedSock.write = function (data) { |
|
|
|
assert.equal(data.toString("ascii"), "001 some_nick :Welcome to the example IRC Project some_nick!~guest@127.0.0.1\r\n") |
|
|
|
assert.equal(data.toString("ascii"), ":irc.example.com 001 some_nick :Welcome to the example IRC Project some_nick!~guest@127.0.0.1\r\n") |
|
|
|
done() |
|
|
|
} |
|
|
|
mockedSock.destroy = function () { |
|
|
|