From 3b5b6934036c183048f974ad202207ccd9741ba2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 3 Jun 2021 13:29:32 +0200 Subject: [PATCH] Use bufName in addMessage, fix missing Client.isMyNick() --- components/app.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/app.js b/components/app.js index 414e253..b97a490 100644 --- a/components/app.js +++ b/components/app.js @@ -486,14 +486,13 @@ export default class App extends Component { var msgUnread = Unread.NONE; if ((msg.command == "PRIVMSG" || msg.command == "NOTICE") && !isRead) { - var target = msg.params[0]; var text = msg.params[1]; var kind; if (msg.isHighlight) { msgUnread = Unread.HIGHLIGHT; kind = "highlight"; - } else if (target == client.nick) { + } else if (client.isMyNick(bufName)) { msgUnread = Unread.HIGHLIGHT; kind = "private message"; } else { @@ -502,8 +501,8 @@ export default class App extends Component { if (msgUnread == Unread.HIGHLIGHT && window.Notification && Notification.permission === "granted" && !isDelivered && !irc.parseCTCP(msg)) { var title = "New " + kind + " from " + msg.prefix.name; - if (this.isChannel(target)) { - title += " in " + target; + if (this.isChannel(bufName)) { + title += " in " + bufName; } var notif = new Notification(title, { body: stripANSI(text), @@ -511,7 +510,7 @@ export default class App extends Component { }); notif.addEventListener("click", () => { // TODO: scroll to message - this.switchBuffer({ server: serverID, name: target }); + this.switchBuffer({ server: serverID, name: bufName }); }); } }