Skip to content

check if an user is present in the channel for nickchange #241

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

Merged
merged 1 commit into from
May 16, 2017

Conversation

rschoebel
Copy link

i only check if the channel has been tracked, not if the user was present in the channel.

i fu**ed up, i'm sorry :D

@coveralls
Copy link

coveralls commented May 16, 2017

Coverage Status

Coverage increased (+0.006%) to 98.456% when pulling fd95d7d on Junky2k:master into 5453e45 on reactiflux:master.

this.channelUsers[channel].delete(oldNick);
this.channelUsers[channel].add(newNick);
this.sendExactToDiscord(channel, `*${oldNick}* is now known as ${newNick}`);
}
} else {
logger.warn(`No channelUsers found for ${channel} when ${oldNick} changed.`);
Copy link
Member

Choose a reason for hiding this comment

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

To be honest I don't think we really need the logger warning here, so maybe just fold the two ifs into one and do if (this.channelUsers[channel] && this.channelUsers[channel].has(oldNick)) {?

Copy link
Member

Choose a reason for hiding this comment

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

Or what do you think @Throne3d?

Copy link
Collaborator

@Throne3d Throne3d May 16, 2017

Choose a reason for hiding this comment

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

The logger warning probably isn't necessary – it was mostly to get around the issue with lowercasing channel names, in the other events. I don't think it's harmful to leave it though.

Copy link
Member

Choose a reason for hiding this comment

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

Eh, I guess not. Just a bit cleaner code, but it'll do.

@ekmartin ekmartin requested a review from Throne3d May 16, 2017 14:40
@ekmartin
Copy link
Member

no worries, thanks for the fix :)

@ekmartin ekmartin merged commit 8c4d83a into reactiflux:master May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants