Merge pull request #765 from stepie22/date-separator-fixes

Date separator fixes
This commit is contained in:
Jérémie Astori 2016-12-04 20:13:09 -05:00 committed by GitHub
commit 9e249a1d2f
2 changed files with 9 additions and 4 deletions

View File

@ -420,9 +420,12 @@ $(function() {
// Remove the date-change marker we put at the top, because it may // Remove the date-change marker we put at the top, because it may
// not actually be a date change now // not actually be a date change now
var firstChild = $(chan).children().eq(0); var children = $(chan).children();
if (firstChild.attr("class") === "date-marker") { if (children.eq(0).hasClass("date-marker")) { // Check top most child
firstChild.remove(); 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 // get the scrollable wrapper around messages

View File

@ -32,6 +32,7 @@ module.exports = function(irc, network) {
var msg = new Msg({ var msg = new Msg({
self: data.nick === irc.user.nick, self: data.nick === irc.user.nick,
type: Msg.Type.TOGGLE, type: Msg.Type.TOGGLE,
time: data.time, // msg handles it if it isn't defined
}); });
chan.pushMessage(client, msg); chan.pushMessage(client, msg);
@ -49,7 +50,8 @@ function parse(msg, url, res, client) {
head: "", head: "",
body: "", body: "",
thumb: "", thumb: "",
link: url link: url,
time: msg.time,
}; };
switch (res.type) { switch (res.type) {