diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-05-03 19:22:51 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-05-03 19:22:51 +0200 |
commit | 88590b85a4dcd20a91b9844dfff353996bc81119 (patch) | |
tree | 74ab949cebdcc6b0f21c8f37537c4538dee435f9 /lib/rbot/rfc2812.rb | |
parent | 5079554263a9a2c8c661c1c8728b4ce1a0bbd05a (diff) |
Preliminary support for the LIST command
Diffstat (limited to 'lib/rbot/rfc2812.rb')
-rw-r--r-- | lib/rbot/rfc2812.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb index fb70619c..cd32135a 100644 --- a/lib/rbot/rfc2812.rb +++ b/lib/rbot/rfc2812.rb @@ -946,6 +946,9 @@ module Irc ERR_NOSERVICEHOST=492 RPL_DATASTR=290 + # A structure to hold LIST data, in the Irc namespace + ListData = Struct.new :channel, :users, :topic + # Implements RFC 2812 and prior IRC RFCs. # # Clients should register Proc{}s to handle the various server events, and @@ -1344,6 +1347,18 @@ module Irc @whois[:channels] << [chan, modes] end + when RPL_LISTSTART + # ignore + when RPL_LIST + @list ||= Hash.new + chan = argv[1] + users = argv[2] + topic = argv[3] + @list[chan] = ListData.new(chan, users, topic) + when RPL_LISTEND + @list ||= Hash.new + data[:list] = @list + handle(:list, data) when RPL_CHANNELMODEIS parse_mode(serverstring, argv[1..-1], data) handle(:mode, data) |