X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Firc.rb;h=2eb676e2ed0506ce465f59f492884044b5241362;hb=be13464e9f3f41936bea6b4cf5ad6acf965a82a6;hp=1e1c56b075d5de55f12e01c073676228206a8ad6;hpb=a915f365139217ba985603181a7c7ceda3f1d9c6;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb index 1e1c56b0..2eb676e2 100644 --- a/lib/rbot/irc.rb +++ b/lib/rbot/irc.rb @@ -922,7 +922,7 @@ module Irc class User < Netmask alias :to_s :nick - attr_accessor :real_name + attr_accessor :real_name, :idle_since, :signon # Create a new IRC User from a given Netmask (or anything that can be converted # into a Netmask) provided that the given Netmask does not have globs. @@ -934,6 +934,8 @@ module Irc raise ArgumentError, "#{str.inspect} must not have globs (unescaped * or ?)" if host.has_irc_glob? && host != "*" @away = false @real_name = String.new + @idle_since = nil + @signon = nil end # The nick of a User may be changed freely, but it must not contain glob patterns. @@ -1299,12 +1301,15 @@ module Irc include ServerOrCasemap attr_reader :name, :topic, :mode, :users alias :to_s :name + attr_accessor :creation_time, :url def inspect str = self.__to_s__[0..-2] str << " on server #{server}" if server str << " @name=#{@name.inspect} @topic=#{@topic.text.inspect}" str << " @users=[#{user_nicks.sort.join(', ')}]" + str << " (created on #{creation_time})" if creation_time + str << " (URL #{url})" if url str << ">" end @@ -1368,6 +1373,12 @@ module Irc # Flags @mode = ModeHash.new + + # creation time, only on some networks + @creation_time = nil + + # URL, only on some networks + @url = nil end # Removes a user from the channel