Skip to content

Commit

Permalink
Merge pull request #143 from vith/fix-shadowed-this
Browse files Browse the repository at this point in the history
fix 'this' shadowing in IrcChannel causing errors
  • Loading branch information
prawnsalad authored May 25, 2018
2 parents 6ce0e55 + 99f6b08 commit 0551c95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = class IrcChannel {
}

// There can be multiple modes set at once, loop through
_.each(event.modes, function(mode) {
_.each(event.modes, mode => {
// If this mode has a user prefix then we need to update the user object
// eg. +o +h +v
let user_prefix = _.find(irc_client.network.options.PREFIX, {
Expand All @@ -85,9 +85,9 @@ module.exports = class IrcChannel {
// TODO : manage channel mode changes
} else { // It's a user mode
// Find the user affected
let user = _.find(this.users, function(user) {
return user.nick.toLowerCase() === mode.param.toLowerCase();
});
let user = _.find(this.users, user =>
user.nick.toLowerCase() === mode.param.toLowerCase()
);

if (!user) {
return;
Expand Down

0 comments on commit 0551c95

Please sign in to comment.