Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date separator fixes #765

Merged
merged 4 commits into from
Dec 5, 2016
Merged

Conversation

PolarizedIons
Copy link
Contributor

Fixes #763 and #760; I decided to do this in one pr since both are so small fixes.

For #763 an extra check was added for the new-messages marker and skips it

For #760 I added the reported time, if that was not available, the current time

@@ -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 || new Date().getTime(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Msg handles the fallback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, will remove that part then

if (children.eq(0).attr("class") === "date-marker") { // Check top most child
children.eq(0).remove();
} else if (children.eq(0).attr("class") === "unread-marker" && children.eq(1).attr("class") === "date-marker") {
// Otherwise the date-marker would get 'stuck' because of the new-massages marker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slight nit-pick: new-massages -> new-message

@MaxLeiter
Copy link
Member

Am just going to mention this here: once the client can access npm packages, we can use moments .calender() to create fuzzy time stamps (i.e. "Yesterday")

Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, 1 small thing.

if (firstChild.attr("class") === "date-marker") {
firstChild.remove();
var children = $(chan).children();
if (children.eq(0).attr("class") === "date-marker") { // Check top most child
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait, can you use jquery's hasClass instead? Because this will only give oyu 1 of the classes, which means that it could create bugs in the future if the date marker ends up having more than 1 class on it.

https://api.jquery.com/hasclass/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good idea, will change

var children = $(chan).children();
if (children.eq(0).attr("class") === "date-marker") { // Check top most child
children.eq(0).remove();
} else if (children.eq(0).attr("class") === "unread-marker" && children.eq(1).attr("class") === "date-marker") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AlMcKinlay AlMcKinlay added Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. second review needed labels Dec 1, 2016
@AlMcKinlay AlMcKinlay self-assigned this Dec 1, 2016
@astorije astorije merged commit 9e249a1 into thelounge:master Dec 5, 2016
@astorije astorije added this to the 2.2.0 milestone Dec 5, 2016
@astorije astorije self-assigned this Dec 5, 2016
@PolarizedIons
Copy link
Contributor Author

Err. @astorije didn't this need to be squashed? I am away for a bit so I can't do it, but pretty sure there is an option for you guys to do so. Referring to the last two commits

@astorije
Copy link
Member

astorije commented Dec 5, 2016

Argh, I suck, I meant for it then forgot. Too late now, sorry git history!

matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
@AlMcKinlay AlMcKinlay removed their assignment Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date-separator not being removed when it should sometimes
5 participants