-
Notifications
You must be signed in to change notification settings - Fork 703
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
Fill in prefixLookup on network initialization #647
Conversation
3811336
to
6601ede
Compare
I have no idea how that's possible because that file hasn't changed since May, but GitHub says you have conflicts on |
@@ -1,5 +1,6 @@ | |||
var _ = require("lodash"); | |||
var Chan = require("./chan"); | |||
var NetworkInfo = require("irc-framework/src/networkinfo"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of requering files like that. I think you can just access the network object in the connect event.
Fair point. I’m not sure how to write a test that calls connect without
|
@nornagon tests are not critical to have (in the current state of things anyway). |
It doesn't conflict, but it needs updating. On Sun, 9 Oct 2016, 22:35 Jérémie Astori, notifications@github.com wrote:
|
6601ede
to
8cd3378
Compare
moved code to |
@@ -48,6 +48,11 @@ module.exports = function(irc, network) { | |||
}); | |||
|
|||
irc.on("socket connected", function() { | |||
network.prefixLookup = {}; | |||
_.each(irc.network.options.PREFIX, function(mode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a nitpick, but any reason to use Lodash's .each
instead of native forEach
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, no reason. fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You fixed it in the wrong place 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gah, haha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed for real this time
8cd3378
to
3b1cb96
Compare
3b1cb96
to
b7814bc
Compare
Fill in prefixLookup on network initialization
Hey @nornagon, we have free sticker packs for our contributors now! |
Fixes #644.
I'm not sure if directly reaching into
irc-framework/src/networkinfo
is a good idea here, but it seems like irc-fw only creates this object when you callconnect()
, and I don't know of a good way to test that.