summaryrefslogtreecommitdiff
path: root/lib/rbot/rfc2812.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-08-09 23:26:03 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-08-09 23:26:03 +0200
commit2f2644f03203b36fd6aa105e62f4cd15070e1cbe (patch)
tree55d6328390f08cf4a4a03ee4b91809f916df0c9f /lib/rbot/rfc2812.rb
parent58b43c90ef7435713213015848eaf0486fab0b8f (diff)
+ support channel URL and creation time
Diffstat (limited to 'lib/rbot/rfc2812.rb')
-rw-r--r--lib/rbot/rfc2812.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb
index 378036de..ac448883 100644
--- a/lib/rbot/rfc2812.rb
+++ b/lib/rbot/rfc2812.rb
@@ -144,6 +144,12 @@ module Irc
# "<channel> <mode> <mode params>"
RPL_CHANNELMODEIS=324
+ # "<channel> <unixtime>"
+ RPL_CREATIONTIME=329
+
+ # "<channel> <url>"
+ RPL_CHANNEL_URL=328
+
# "<channel> :No topic is set"
RPL_NOTOPIC=331
@@ -1279,6 +1285,16 @@ module Irc
when RPL_CHANNELMODEIS
parse_mode(serverstring, argv[1..-1], data)
handle(:mode, data)
+ when RPL_CREATIONTIME
+ data[:channel] = argv[1]
+ data[:time] = Time.at(argv[2].to_i)
+ @server.get_channel(data[:channel]).creation_time=data[:time]
+ handle(:creationtime, data)
+ when RPL_CHANNEL_URL
+ data[:channel] = argv[1]
+ data[:url] = argv[2]
+ @server.get_channel(data[:channel]).url=data[:url].dup
+ handle(:channel_url, data)
else
warning "Unknown message #{serverstring.inspect}"
handle(:unknown, data)