Merge pull request #1720 from thelounge/xpaw/fix-new-user-obj

Access new nick attribute in user object
This commit is contained in:
Jérémie Astori 2017-11-21 19:28:37 -05:00 committed by GitHub
commit a10f147c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -82,10 +82,10 @@ function processReceivedMessage(data) {
if ((data.msg.type === "message" || data.msg.type === "action" || data.msg.type === "notice") && channel.hasClass("channel")) { if ((data.msg.type === "message" || data.msg.type === "action" || data.msg.type === "notice") && channel.hasClass("channel")) {
const nicks = channel.find(".users").data("nicks"); const nicks = channel.find(".users").data("nicks");
if (nicks) { if (nicks) {
const find = nicks.indexOf(data.msg.from); const find = nicks.indexOf(data.msg.from.nick);
if (find !== -1) { if (find !== -1) {
nicks.splice(find, 1); nicks.splice(find, 1);
nicks.unshift(data.msg.from); nicks.unshift(data.msg.from.nick);
} }
} }
} }
@ -118,9 +118,9 @@ function notifyMessage(targetId, channel, msg) {
if (msg.type === "invite") { if (msg.type === "invite") {
title = "New channel invite:"; title = "New channel invite:";
body = msg.from + " invited you to " + msg.channel; body = msg.from.nick + " invited you to " + msg.channel;
} else { } else {
title = msg.from; title = msg.from.nick;
if (!button.hasClass("query")) { if (!button.hasClass("query")) {
title += " (" + button.data("title").trim() + ")"; title += " (" + button.data("title").trim() + ")";
} }