Changeset 2f2644f03203b36fd6aa105e62f4cd15070e1cbe

Show
Ignore:
Timestamp:
08/10/08 01:26:03 (3 months ago)
Author:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
git-committer:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1218317163 +0200
git-parent:

[58b43c90ef7435713213015848eaf0486fab0b8f]

git-author:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1218317163 +0200
Message:

+ support channel URL and creation time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/rbot/irc.rb

    ra915f36 r2f2644f  
    13001300    attr_reader :name, :topic, :mode, :users 
    13011301    alias :to_s :name 
     1302    attr_accessor :creation_time, :url 
    13021303 
    13031304    def inspect 
     
    13061307      str << " @name=#{@name.inspect} @topic=#{@topic.text.inspect}" 
    13071308      str << " @users=[#{user_nicks.sort.join(', ')}]" 
     1309      str << " (created on #{creation_time})" if creation_time 
     1310      str << " (URL #{url})" if url 
    13081311      str << ">" 
    13091312    end 
     
    13691372      # Flags 
    13701373      @mode = ModeHash.new 
     1374 
     1375      # creation time, only on some networks 
     1376      @creation_time = nil 
     1377 
     1378      # URL, only on some networks 
     1379      @url = nil 
    13711380    end 
    13721381 
  • lib/rbot/rfc2812.rb

    rd5b21e2 r2f2644f  
    144144  # "<channel> <mode> <mode params>" 
    145145  RPL_CHANNELMODEIS=324 
     146 
     147  # "<channel> <unixtime>" 
     148  RPL_CREATIONTIME=329 
     149 
     150  # "<channel> <url>" 
     151  RPL_CHANNEL_URL=328 
    146152 
    147153  # "<channel> :No topic is set" 
     
    12801286          parse_mode(serverstring, argv[1..-1], data) 
    12811287          handle(:mode, data) 
     1288        when RPL_CREATIONTIME 
     1289          data[:channel] = argv[1] 
     1290          data[:time] = Time.at(argv[2].to_i) 
     1291          @server.get_channel(data[:channel]).creation_time=data[:time] 
     1292          handle(:creationtime, data) 
     1293        when RPL_CHANNEL_URL 
     1294          data[:channel] = argv[1] 
     1295          data[:url] = argv[2] 
     1296          @server.get_channel(data[:channel]).url=data[:url].dup 
     1297          handle(:channel_url, data) 
    12821298        else 
    12831299          warning "Unknown message #{serverstring.inspect}"