Fix nick changes not being properly reported in the logs

Before:

```
[2016-10-10 15:17:47] *  nick
```

After:

```
[2016-10-10 16:32:47] * astorije nick astorije2
```
This commit is contained in:
Jérémie Astori 2016-10-10 13:08:23 -04:00
parent 7e39ae045f
commit 310ab8f43c
3 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,3 @@
<span role="button" class="user {{colorClass nick}}" data-name="{{nick}}">{{mode}}{{nick}}</span>
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span>
is now known as
<span role="button" class="user {{colorClass new_nick}}" data-name="{{new_nick}}">{{mode}}{{new_nick}}</span>

View File

@ -36,9 +36,9 @@ module.exports = function(irc, network) {
});
msg = new Msg({
time: data.time,
from: data.nick,
type: Msg.Type.NICK,
mode: chan.getMode(data.new_nick),
nick: data.nick,
new_nick: data.new_nick,
self: self
});

View File

@ -37,7 +37,9 @@ module.exports.write = function(user, network, chan, msg) {
line += msg.type;
if (msg.text) {
if (msg.new_nick) { // `/nick <new_nick>`
line += ` ${msg.new_nick}`;
} else if (msg.text) {
line += ` ${msg.text}`;
}
}