according to the RFC the correct response to the NICK command then it's
changing a nickname is to send a NICK command to the user from the
original nickname.
This patch changes the behaviour and removes a duplicate declearation of
the function.
Before we tested channel implicitly by running it through the tests on
the server.js. After some learning today, it's time to add an own set of
unit tests to channel.
In order to send channel messages, we need to set a different target
than the user himself. This patch adds a new parameter `to` to the
`sendMsg()` function of the user object and allows to provide a string
as target.
This uses by default the user's nickname as target, which makes the
parameter optional and doesn't break the existing interface.
This change removes server object interacting with an internal variable
from the user object creation and reduces the amount of code from 3 to 1
line. This also simplifies future testing.