{"action":"created","issue":{"url":"https://api.github.com/repos/cinchrb/cinch/issues/226","repository_url":"https://api.github.com/repos/cinchrb/cinch","labels_url":"https://api.github.com/repos/cinchrb/cinch/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/cinchrb/cinch/issues/226/comments","events_url":"https://api.github.com/repos/cinchrb/cinch/issues/226/events","html_url":"https://github.com/cinchrb/cinch/issues/226","id":155808754,"number":226,"title":"Error when connecting to irc.gitter.im","user":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-19T18:52:25Z","updated_at":"2016-05-20T06:01:57Z","closed_at":null,"body":"I am writing a chat bot for gitter.im using their IRC bridge (irc.gitter.im).  I get the following error when I connect:\r\n\r\n```\r\n[2016/05/19 14:33:54.525] !! /Users/jfrey/.gem/ruby/2.2.4/gems/cinch-2.3.2/lib/cinch/irc.rb:729:in `on_352': undefined method `split' for nil:NilClass (NoMethodError)\r\n[2016/05/19 14:33:54.525] !! \t/Users/jfrey/.gem/ruby/2.2.4/gems/cinch-2.3.2/lib/cinch/irc.rb:263:in `parse'\r\n[2016/05/19 14:33:54.526] !! \t/Users/jfrey/.gem/ruby/2.2.4/gems/cinch-2.3.2/lib/cinch/irc.rb:151:in `block (2 levels) in start_reading_thread'\r\n[2016/05/19 14:33:54.526] !! \t/Users/jfrey/.gem/ruby/2.2.4/gems/cinch-2.3.2/lib/cinch/helpers.rb:123:in `rescue_exception'\r\n[2016/05/19 14:33:54.526] !! \t/Users/jfrey/.gem/ruby/2.2.4/gems/cinch-2.3.2/lib/cinch/irc.rb:149:in `block in start_reading_thread'\r\n```\r\n\r\nWhat I am seeing is that after the `/NAMES` is sent, the users list is processed.  A normal user looks like this:\r\n\r\n```\r\n[2016/05/19 14:33:54.504] >> :irc.gitter.im 352 miq-bot #manageiq/manageiq Fryguy irc.gitter.im irc.gitter.im Fryguy H :0 Jason Frey\r\n```\r\n\r\nHowever, the failure occurs when processing the \"Gitter Bot\" user (not my bot...this is Gitter's own internal bot account), whose line looks like this:\r\n\r\n```\r\n[2016/05/19 14:33:54.525] >> :irc.gitter.im 352 miq-bot #manageiq/manageiq gitter :irc.gitter.im irc.gitter.im gitter H :0 Gitter Bot\r\n```\r\n\r\nNotice the `:` before `irc.gitter.im` in the middle of the string.  This causes the [Message#parse_params regex](https://github.com/cinchrb/cinch/blob/f3d07bbde0f802a38777383b7876fe2b8463d54d/lib/cinch/message.rb#L260) to not properly match.  See below for the differences in the values of raw_params after that Regex match.\r\n\r\n\r\n```ruby\r\n# with \":irc.gitter.im 352 miq-bot #manageiq/manageiq Fryguy irc.gitter.im irc.gitter.im Fryguy H :0 Jason Frey\")\r\n[\"miq-bot\", \"#manageiq/manageiq\", \"Fryguy\", \"irc.gitter.im\", \"irc.gitter.im\", \"Fryguy\", \"H\", \"0 Jason Frey\"]\r\n\r\n# with \":irc.gitter.im 352 miq-bot #manageiq/manageiq gitter :irc.gitter.im irc.gitter.im gitter H :0 Gitter Bot\"\r\n[\"miq-bot\", \"#manageiq/manageiq\", \"gitter\", \"irc.gitter.im irc.gitter.im gitter H :0 Gitter Bot\"]\r\n```\r\n\r\nSo, I clearly see *why* it blows up, but I have no idea how to fix it properly.  Is this a bug on Gitter's side, or is this a bug in cinch in how it parses the output?\r\n"},"comment":{"url":"https://api.github.com/repos/cinchrb/cinch/issues/comments/220524319","html_url":"https://github.com/cinchrb/cinch/issues/226#issuecomment-220524319","issue_url":"https://api.github.com/repos/cinchrb/cinch/issues/226","id":220524319,"user":{"login":"txdv","id":116642,"avatar_url":"https://avatars.githubusercontent.com/u/116642?v=3","gravatar_id":"","url":"https://api.github.com/users/txdv","html_url":"https://github.com/txdv","followers_url":"https://api.github.com/users/txdv/followers","following_url":"https://api.github.com/users/txdv/following{/other_user}","gists_url":"https://api.github.com/users/txdv/gists{/gist_id}","starred_url":"https://api.github.com/users/txdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/txdv/subscriptions","organizations_url":"https://api.github.com/users/txdv/orgs","repos_url":"https://api.github.com/users/txdv/repos","events_url":"https://api.github.com/users/txdv/events{/privacy}","received_events_url":"https://api.github.com/users/txdv/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T06:01:57Z","updated_at":"2016-05-20T06:01:57Z","body":"Can you put a link to the bug report? If they actually have something like that publicly available."}}
{"actor":{"display_login":"txdv"}}