diff --git a/client/js/lounge.js b/client/js/lounge.js index a665dca9..dea07450 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -420,9 +420,12 @@ $(function() { // Remove the date-change marker we put at the top, because it may // not actually be a date change now - var firstChild = $(chan).children().eq(0); - if (firstChild.attr("class") === "date-marker") { - firstChild.remove(); + var children = $(chan).children(); + if (children.eq(0).hasClass("date-marker")) { // Check top most child + children.eq(0).remove(); + } else if (children.eq(0).hasClass("unread-marker") && children.eq(1).hasClass("date-marker")) { + // Otherwise the date-marker would get 'stuck' because of the new-message marker + children.eq(1).remove(); } // get the scrollable wrapper around messages diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 8e7e900b..ff2ceac9 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -32,6 +32,7 @@ module.exports = function(irc, network) { var msg = new Msg({ self: data.nick === irc.user.nick, type: Msg.Type.TOGGLE, + time: data.time, // msg handles it if it isn't defined }); chan.pushMessage(client, msg); @@ -49,7 +50,8 @@ function parse(msg, url, res, client) { head: "", body: "", thumb: "", - link: url + link: url, + time: msg.time, }; switch (res.type) {