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

HUBOT_IRC_IGNOREINVITE has opposite effect #163

Open
shortspecialbus opened this issue Jun 16, 2016 · 0 comments
Open

HUBOT_IRC_IGNOREINVITE has opposite effect #163

shortspecialbus opened this issue Jun 16, 2016 · 0 comments

Comments

@shortspecialbus
Copy link

shortspecialbus commented Jun 16, 2016

Hi,

I noticed my bot was accepting invites to random channels despite having both HUBOT_IRC_PRIVATE and HUBOT_IRC_IGNOREINVITE set to 'true.'

Some investigation found the issue. Line 333 in irc.coffee is:

  if not process.env.HUBOT_IRC_PRIVATE or process.env.HUBOT_IRC_IGNOREINVITE

This actually seems to work opposite - the order of operations is wrong. I believe it works out as

If (not process.env.HUBOT_IRC_PRIVATE) or (process.env.HUBOT_IRC_IGNOREINVITE)

So, if you set it, it won't ignore the invite. This is fixed by either unsetting HUBOT_IRC_IGNOREINVITE which is more of a workaround than a fix, or the following change. I don't know coffeescript but I was able to fix it in my test by changing the line to:

  if not process.env.HUBOT_IRC_PRIVATE or not process.env.HUBOT_IRC_IGNOREINVITE

But I'm not 100% sure that's the correct fix, hence why I'm not doing a pull. Thought I'd mention it in here though.

-stefan

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

No branches or pull requests

1 participant