Access new nick attribute in user object

This was broken in #1698
This commit is contained in:
Pavel Djundik 2017-11-21 13:54:12 +02:00
parent 489bb8e395
commit c268d91b4e

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")) {
const nicks = channel.find(".users").data("nicks");
if (nicks) {
const find = nicks.indexOf(data.msg.from);
const find = nicks.indexOf(data.msg.from.nick);
if (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") {
title = "New channel invite:";
body = msg.from + " invited you to " + msg.channel;
body = msg.from.nick + " invited you to " + msg.channel;
} else {
title = msg.from;
title = msg.from.nick;
if (!button.hasClass("query")) {
title += " (" + button.data("title").trim() + ")";
}