diff --git a/client/js/lounge.js b/client/js/lounge.js index 41dd41a2ff..1b64c66d02 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -213,6 +213,10 @@ $(function() { target = "#chan-" + chat.find(".active").data("id"); } + // Modifying data.msg.highlight directly breaks notifications, as + // everything is passed by instance in javascript, not by value + data.msg.shouldHighlight = data.msg.highlight && data.msg.chanType !== "query"; + var chan = chat.find(target); var msg; @@ -803,7 +807,7 @@ $(function() { body = msg.from + " invited you to " + msg.channel; } else { title = msg.from; - if (!button.hasClass("query")) { + if (msg.chanType !== "query") { title += " (" + button.data("title").trim() + ")"; } title += " says:"; @@ -827,8 +831,7 @@ $(function() { } } - button = button.filter(":not(.active)"); - if (button.length === 0) { + if (button.hasClass("active")) { return; } diff --git a/client/views/msg.tpl b/client/views/msg.tpl index e605bd9570..6c716de495 100644 --- a/client/views/msg.tpl +++ b/client/views/msg.tpl @@ -1,4 +1,4 @@ -
+
{{tz time}} diff --git a/client/views/msg_action.tpl b/client/views/msg_action.tpl index 2eb1fe85cd..4db75a9ae2 100644 --- a/client/views/msg_action.tpl +++ b/client/views/msg_action.tpl @@ -1,4 +1,4 @@ -
+
{{tz time}} diff --git a/src/plugins/irc-events/message.js b/src/plugins/irc-events/message.js index 65e0bcb1ee..f8fa36cbc5 100644 --- a/src/plugins/irc-events/message.js +++ b/src/plugins/irc-events/message.js @@ -46,7 +46,6 @@ module.exports = function(irc, network) { if (data.type === Msg.Type.NOTICE) { chan = network.channels[0]; } else { - highlight = !self; chan = new Chan({ type: Chan.Type.QUERY, name: target @@ -58,10 +57,14 @@ module.exports = function(irc, network) { }); } } + + // Query messages (unless self) always highlight + if (chan.type === Chan.Type.QUERY) { + highlight = !self; + } } - // Query messages (unless self) always highlight - // Self messages are never highlighted + // Self messages in channels are never highlighted // Non-self messages are highlighted as soon as the nick is detected if (!highlight && !self) { highlight = network.highlightRegex.test(data.message); @@ -76,6 +79,7 @@ module.exports = function(irc, network) { } var msg = new Msg({ + chanType: chan.type, type: data.type, time: data.time, mode: chan.getMode(data.nick),