Merge pull request #685 from thelounge/astorije/fix-nick-in-logs

Fix nick changes not being properly reported in the logs
This commit is contained in:
Pavel Djundik 2016-10-15 14:00:47 +03:00 committed by GitHub
commit a58b7839a7
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}`;
}
}