You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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:
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:
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
The text was updated successfully, but these errors were encountered: