User.channels returns an empty array #123

tiegs opened this Issue Jul 14, 2013 · 1 comment


None yet

2 participants

tiegs commented Jul 14, 2013

I'm writing a bot for quakenet, when trying to get a users channels using the user.channels-method, cinch returns an empty array.

A short snippet what I'm trying to archive:

on :private, "!status" do |m|

  puts "CHANNELS: #{user.channels}"

=> []

I assume this is caused by the array generated by Cinch::IRC::on_319 is overwritten by Cinch::User::end_of_whois.
If instead the array is submitted by using the @whois_updates[user].merge!-method in Cinch::IRC::on_319 the channels are assigned correctly (at least for me).

Additionally the regex (/#{@isupport["CHANTYPES"].join}[^ ]+/o) used by Cinch::IRC::on_319 did not create an array of Channel-objects in my project.

I'm using ruby 2.0.0p247 and cinch 2.0.5 on Linux.

I'm not sure if my change does not break any design-principles of cinch. Anyway I commited it to my fork, 3cd4e6c

Maybe it's going to help you solving the problem :)


Yeah, looks like you found two bugs in the on_319 method (wrong regexp and wrong way of setting the channels). I'll test your change later today and commit it if it works.

If you send your change as a pull request I'll merge them with your name.

@dominikh dominikh closed this Jul 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment