potato 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -356,7 +356,11 @@ Type /pass yourpassword to authenticate.
356
356
  str = opts[:colon] ? ":" : ""
357
357
  str << opts[:cmd] << " " << Array(opts[:args]).join(" ")
358
358
  str << " :#{opts[:content]}" if opts[:content]
359
- @socket.write(str + "\r\n")
359
+ begin
360
+ @socket.write(str + "\r\n")
361
+ rescue Errno::ETIMEDOUT
362
+ close
363
+ end
360
364
  debug str
361
365
  end
362
366
 
@@ -33,13 +33,19 @@ module Potato
33
33
  # @param [IRC::Packet] pkt
34
34
  # @return [void]
35
35
  def on_who pkt
36
- users = @users[pkt.args[0].sub("#", "")].map(&:first)
37
- users.uniq.each do |user|
38
- send_packet :cmd => "localhost", :args => [352, @config.nick, pkt.args[0], user,
36
+ Thread.new do
37
+ loop do
38
+ break if @users[pkt.args[0].sub("#", "")]
39
+ sleep 1
40
+ end
41
+ users = @users[pkt.args[0].sub("#", "")].map(&:first)
42
+ users.uniq.each do |user|
43
+ send_packet :cmd => "localhost", :args => [352, @config.nick, pkt.args[0], user,
39
44
  host_for(user), "localhost", user], :content => "0 #{user}"
40
- end
41
- send_packet :cmd => "localhost", :args => [315, @config.nick, pkt.args[0]],
45
+ end
46
+ send_packet :cmd => "localhost", :args => [315, @config.nick, pkt.args[0]],
42
47
  :content => "End of /WHO list."
48
+ end
43
49
  end
44
50
 
45
51
  # @param [IRC::Packet] pkt
@@ -66,6 +66,7 @@ module Potato
66
66
  unless pkt.nil?
67
67
  debug pkt.raw, :damn
68
68
  else
69
+ next unless cl
69
70
  cl.notice "Lost connection to dAmn (server closed connection)."
70
71
  cl.socket.close
71
72
  end
@@ -1,4 +1,4 @@
1
1
  module Potato
2
2
  # Current version of Potato.
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-04-27 00:00:00.000000000 -04:00
12
+ date: 2011-06-23 00:00:00.000000000 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
  description: Potato is an IRC server that communicates with the deviantART Message