summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-13 14:31:24 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-13 14:31:24 +0000
commit7b634184a27d3be3d6a664b6622e6d446f54f18d (patch)
tree69e65d7351dac086e982d289e59415745ef803fa /lib/rbot
parentd3bcd981d1dee695726c0d09376971b6d95309dd (diff)
ircbot shouldn't issue {{{@socket}}} commands when disconnected
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/ircbot.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 0cfc3f12..aebb7db4 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -490,12 +490,14 @@ class IrcBot
# @registry.close
debug "Cleaning up the db environment"
DBTree.cleanup_env
- debug "Sending quit message"
- @socket.puts "QUIT :#{message}"
- debug "Flushing socket"
- @socket.flush
- debug "Shutting down socket"
- @socket.shutdown
+ if @socket.connected?
+ debug "Sending quit message"
+ @socket.puts "QUIT :#{message}"
+ debug "Flushing socket"
+ @socket.flush
+ debug "Shutting down socket"
+ @socket.shutdown
+ end
puts "rbot quit (#{message})"
end