]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/irc.rb
rss plugin: watching now relies on an ID built from title, link and description to...
[user/henk/code/ruby/rbot.git] / lib / rbot / irc.rb
index 45e1495960569e30052d2e6b035311e42082bb55..398f74d16999e6fe0cbc8b5f16b162b0e1ecea74 100644 (file)
@@ -629,12 +629,19 @@ module Irc
       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
@@ -900,7 +907,7 @@ module Irc
     # 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
@@ -1164,7 +1171,7 @@ module Irc
       #\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