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

Bug fix in join/part/kick events #11

Merged
merged 1 commit into from
Apr 29, 2011
Merged

Conversation

luscoma
Copy link
Contributor

@luscoma luscoma commented Apr 29, 2011

Fixed bug in JOIN/PART/KICK where crash could occur if channel name was different case than expected.

Example: if bot joins IRC channel using the channel name #channel. It creates a key self.chans["#channel"].users = {}. Since channel names are case insensitive, in some cases people joining the channel may join with #Channel, #ChAnNeL, or some other variation. Many IRCDs do not change the channel name to be consistent when broadcasting the event so the bot running irc lib will receive the irc event as :nickname JOIN :#Channel. This will cause an error during join because it looks at self.chans["#Channel"].users for the nicklist which doesn't exist.

To solve this issue all channels names are forced to lower case with message.args[0].toLowerCase() in JOIN/PART/KICK parsing. I only noticed this bug in the JOIN event but it is conceivably possible in the other two as well so I went ahead and modified the code there as well. There may be other places this could be an issue but I tried to get the events where I could foresee it being an issue.

martynsmith added a commit that referenced this pull request Apr 29, 2011
Bug fix in join/part/kick events
@martynsmith martynsmith merged commit 5204bcc into martynsmith:master Apr 29, 2011
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.

None yet

2 participants