[Frugalware-git] mxw: safe_eval / on_identified: make nick case-insensitive

Miklos Vajna vmiklos at frugalware.org
Wed Jan 12 23:13:17 CET 2011


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=mxw.git;a=commitdiff;h=0cc1528f29cef056d2efee1e2dd6a61498cfb6d8

commit 0cc1528f29cef056d2efee1e2dd6a61498cfb6d8
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Wed Jan 12 23:10:42 2011 +0100

safe_eval / on_identified: make nick case-insensitive

diff --git a/events.py b/events.py
index d5c4041..9660a39 100644
--- a/events.py
+++ b/events.py
@@ -1381,13 +1381,13 @@ def inxml(nick):
def safe_eval(nick, cmd, c):
global todo

-	if not inxml(nick):
+	if not inxml(nick.lower()):
return
-	if nick in todo.keys():
-		todo[nick].append(cmd)
+	if nick.lower() in todo.keys():
+		todo[nick.lower()].append(cmd)
else:
-		todo[nick] = [cmd]
-	c.whois([nick])
+		todo[nick.lower()] = [cmd]
+	c.whois([nick.lower()])

def handle_triggers(e, argv, c, source, highlight=False):
for k, v in config.triggers.items():
@@ -1562,7 +1562,7 @@ def on_join(self, c, e):
def on_identified(self, c, e):
global todo

-	nick = e.arguments()[1]
+	nick = e.arguments()[1].lower()
if nick not in todo.keys():
return
for i in todo[nick][-1].split("\n"):


More information about the Frugalware-git mailing list