end\r
end\r
\r
- # A Netmask is easily converted to a String for the usual representation\r
+ # A Netmask is easily converted to a String for the usual representation.\r
+ # We skip the user or host parts if they are "*", unless we've been asked\r
+ # for the full form\r
#\r
+ def to_s\r
+ ret = nick.dup\r
+ ret << "!" << user unless user == "*"\r
+ ret << "@" << host unless host == "*"\r
+ return ret\r
+ end\r
def fullform\r
"#{nick}!#{user}@#{host}"\r
end\r
- alias :to_s :fullform\r
\r
# Converts the receiver into a Netmask with the given (optional)\r
# server/casemap association. We return self unless a conversion\r
# Checks if a User is well-known or not by looking at the hostname and user\r
#\r
def known?\r
- return nick!= "*" && user!="*" && host!="*"\r
+ return nick != "*" && user != "*" && host != "*"\r
end\r
\r
# Is the user away?\r
#\r
def initialize(text="", set_by="", set_on=Time.new)\r
@text = text\r
- @set_by = set_by.to_irc_user\r
+ @set_by = set_by.to_irc_netmask\r
@set_on = set_on\r
end\r
\r
# Resets the Channel and User list\r
#\r
def reset_lists\r
- @users.each { |u|\r
+ @users.reverse_each { |u|\r
delete_user(u)\r
}\r
- @channels.each { |u|\r
+ @channels.reverse_each { |u|\r
delete_channel(u)\r
}\r
end\r