]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Fix casemap/server mismatch problems when moving the bots between servers with differ...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 12 Feb 2007 12:22:27 +0000 (12:22 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 12 Feb 2007 12:22:27 +0000 (12:22 +0000)
lib/rbot/irc.rb

index ab730278e7d03b2ac122223b58d23462f8524401..b8ca459304d453b6e8e183ed656b684a1e7da882 100644 (file)
@@ -547,7 +547,7 @@ module Irc
       if self.class == Netmask\r
         return self if fits_with_server_and_casemap?(opts)\r
       end\r
-      return self.fullform.to_irc_netmask(server_and_casemap.merge(opts))\r
+      return self.downcase.to_irc_netmask(opts)\r
     end\r
 \r
     # Converts the receiver into a User with the given (optional)\r
@@ -821,6 +821,21 @@ module Irc
       end\r
     end\r
 \r
+    # Users can be either simply downcased (their nick only)\r
+    # or fully downcased: this will return the fullform downcased\r
+    # according to the given casemap.\r
+    #\r
+    def full_irc_downcase(cmap=casemap)\r
+      self.fullform.irc_downcase(cmap)\r
+    end\r
+\r
+    # full_downcase() will return the fullform downcased according to the\r
+    # User's own casemap\r
+    #\r
+    def full_downcase\r
+      self.full_irc_downcase\r
+    end\r
+\r
     # Since to_irc_user runs the same checks on server and channel as\r
     # to_irc_netmask, we just try that and return self if it works.\r
     #\r
@@ -828,7 +843,7 @@ module Irc
     #\r
     def to_irc_user(opts={})\r
       return self if fits_with_server_and_casemap?(opts)\r
-      return self.fullform.to_irc_user(server_and_casemap(opts))\r
+      return self.full_downcase.to_irc_user(opts)\r
     end\r
 \r
     # We can replace everything at once with data from another User\r