lib/potato/irc/events.rb in potato-0.0.13 vs lib/potato/irc/events.rb in potato-0.0.14

- old
+ new

@@ -31,16 +31,22 @@ end # @param [IRC::Packet] pkt # @return [void] def on_who pkt - users = @users[pkt.args[0].sub("#", "")].map(&:first) - users.uniq.each do |user| - send_packet :cmd => "localhost", :args => [352, @config.nick, pkt.args[0], user, + Thread.new do + loop do + break if @users[pkt.args[0].sub("#", "")] + sleep 1 + end + users = @users[pkt.args[0].sub("#", "")].map(&:first) + users.uniq.each do |user| + send_packet :cmd => "localhost", :args => [352, @config.nick, pkt.args[0], user, host_for(user), "localhost", user], :content => "0 #{user}" - end - send_packet :cmd => "localhost", :args => [315, @config.nick, pkt.args[0]], + end + send_packet :cmd => "localhost", :args => [315, @config.nick, pkt.args[0]], :content => "End of /WHO list." + end end # @param [IRC::Packet] pkt # @return [void] def on_whois pkt \ No newline at end of file