From 310ab8f43c119746dd9f96faa1aaa3f6593456b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Mon, 10 Oct 2016 13:08:23 -0400 Subject: [PATCH] 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 ``` --- client/views/actions/nick.tpl | 2 +- src/plugins/irc-events/nick.js | 2 +- src/userLog.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/views/actions/nick.tpl b/client/views/actions/nick.tpl index 73c790f4..1c93cb97 100644 --- a/client/views/actions/nick.tpl +++ b/client/views/actions/nick.tpl @@ -1,3 +1,3 @@ -{{mode}}{{nick}} +{{mode}}{{from}} is now known as {{mode}}{{new_nick}} diff --git a/src/plugins/irc-events/nick.js b/src/plugins/irc-events/nick.js index 51929f4c..a1bfc3b7 100644 --- a/src/plugins/irc-events/nick.js +++ b/src/plugins/irc-events/nick.js @@ -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 }); diff --git a/src/userLog.js b/src/userLog.js index d8ce8a8b..4b3020f8 100644 --- a/src/userLog.js +++ b/src/userLog.js @@ -37,7 +37,9 @@ module.exports.write = function(user, network, chan, msg) { line += msg.type; - if (msg.text) { + if (msg.new_nick) { // `/nick ` + line += ` ${msg.new_nick}`; + } else if (msg.text) { line += ` ${msg.text}`; } }