]> git.lizzy.rs Git - luairc.git/commitdiff
fix a bunch of issues dealing with nicks that use capital letters
authorjluehrs2 <jluehrs2@uiuc.edu>
Tue, 4 Sep 2007 05:54:10 +0000 (00:54 -0500)
committerjluehrs2 <jluehrs2@uiuc.edu>
Tue, 4 Sep 2007 05:54:10 +0000 (00:54 -0500)
src/irc.lua

index 12b5408654a3f0d6b253c2a3aee1f07a494b2962..d8b8ba8c056c68119b3a66d8ddd4e7ba6fda74e1 100644 (file)
@@ -401,10 +401,11 @@ end
 
 -- on_rpl_whoisuser {{{
 function handlers.on_rpl_whoisuser(from, nick, user, host, star, realname)
-    nick = nick:lower()
-    requestinfo.whois[nick].user = user
-    requestinfo.whois[nick].host = host
-    requestinfo.whois[nick].realname = realname
+    local lnick = nick:lower()
+    requestinfo.whois[lnick].nick = nick
+    requestinfo.whois[lnick].user = user
+    requestinfo.whois[lnick].host = host
+    requestinfo.whois[lnick].realname = realname
 end
 -- }}}
 
@@ -544,10 +545,11 @@ ctcp_handlers.on_rpl_action = ctcp_handlers.on_action
 
 -- on_rpl_version {{{
 function ctcp_handlers.on_rpl_version(from, to, version)
-    local cb = table.remove(icallbacks.ctcp_version[from], 1)
+    local lfrom = from:lower()
+    local cb = table.remove(icallbacks.ctcp_version[lfrom], 1)
     cb({version = version, nick = from})
-    if #icallbacks.ctcp_version[from] > 0 then say(from, {"VERSION"})
-    else icallbacks.ctcp_version[from] = nil
+    if #icallbacks.ctcp_version[lfrom] > 0 then say(from, {"VERSION"})
+    else icallbacks.ctcp_version[lfrom] = nil
     end
 end
 -- }}}
@@ -560,20 +562,22 @@ end
 
 -- on_rpl_ping {{{
 function ctcp_handlers.on_rpl_ping(from, to, timestamp)
-    local cb = table.remove(icallbacks.ctcp_ping[from], 1)
+    local lfrom = from:lower()
+    local cb = table.remove(icallbacks.ctcp_ping[lfrom], 1)
     cb({time = os.time() - timestamp, nick = from})
-    if #icallbacks.ctcp_ping[from] > 0 then say(from, {"PING " .. os.time()})
-    else icallbacks.ctcp_ping[from] = nil
+    if #icallbacks.ctcp_ping[lfrom] > 0 then say(from, {"PING " .. os.time()})
+    else icallbacks.ctcp_ping[lfrom] = nil
     end
 end
 -- }}}
 
 -- on_rpl_time {{{
 function ctcp_handlers.on_rpl_time(from, to, time)
-    local cb = table.remove(icallbacks.ctcp_time[from], 1)
+    local lfrom = from:lower()
+    local cb = table.remove(icallbacks.ctcp_time[lfrom], 1)
     cb({time = time, nick = from})
-    if #icallbacks.ctcp_time[from] > 0 then say(from, {"TIME"})
-    else icallbacks.ctcp_time[from] = nil
+    if #icallbacks.ctcp_time[lfrom] > 0 then say(from, {"TIME"})
+    else icallbacks.ctcp_time[lfrom] = nil
     end
 end
 -- }}}
@@ -795,7 +799,7 @@ end
 -- @param nick User to request WHOIS information about
 function whois(cb, nick)
     nick = nick:lower()
-    requestinfo.whois[nick] = {nick = nick}
+    requestinfo.whois[nick] = {}
     if not icallbacks.whois[nick] then
         icallbacks.whois[nick] = {cb}
         send("WHOIS", nick)