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

NAMES command crashes client on InspIRCd-2.0 servers #55

Closed
enunez opened this issue Nov 4, 2011 · 0 comments
Closed

NAMES command crashes client on InspIRCd-2.0 servers #55

enunez opened this issue Nov 4, 2011 · 0 comments

Comments

@enunez
Copy link

enunez commented Nov 4, 2011

The problem can be observed by just joining the client to any channel on an inspircd server (e.g., irc.alphachat.net). The problem is that InspIRCd is leaving a trailing space in the names reply, like so:

"353 somenick = #channel : nick1 somenick "

You're splitting on spaces, so you wind up with a blank nickname which you then attempt to parse as though it isn't -- match[1] bombs because it's null.

The solution is to just trim the list of nicknames. Here's the patch:

--- irc.js 2011-11-04 01:39:43.138346320 -0400
+++ irc.js.fixed 2011-11-04 01:41:10.478005694 -0400
@@ -196,7 +196,7 @@
break;
case "rpl_namreply":
var channel = self.chanData(message.args[2]);

  •            var users = message.args[3].split(/ +/);
    
  •            var users = message.args[3].trim().split(/ +/);
             if ( channel ) {
                 users.forEach(function (user) {
                     var match = user.match(/^(.)(.*)$/);
    
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

2 participants