changeset 45:41394ddb3aff

Lower before comparing strings. Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Mon, 24 Aug 2009 20:32:48 +0200
parents 3d964ca1cf89
children d29171ab2df1
files bot.py bridge.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bot.py
+++ b/bot.py
@@ -314,7 +314,7 @@ class bot(Thread):
 					continue
 				
 				# Leaving events
-				if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target() == bridge.irc_room:
+				if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target().lower() == bridge.irc_room:
 					if len(event.arguments()) > 0:
 						leave_message = event.arguments()[0]
 					elif event.eventtype() == 'quit':
@@ -337,7 +337,7 @@ class bot(Thread):
 				
 				# Chan message
 				if event.eventtype() in ['pubmsg', 'action']:
-					if bridge.irc_room == event.target() and bridge.irc_server == connection.server:
+					if bridge.irc_room == event.target().lower() and bridge.irc_server == connection.server:
 						self.error(event_str, debug=True)
 						message = event.arguments()[0]
 						if event.eventtype() == 'action':
--- a/bridge.py
+++ b/bridge.py
@@ -44,7 +44,7 @@ class bridge:
 		self.bot = owner_bot
 		self.irc_server = irc_server
 		self.irc_port = irc_port
-		self.irc_room = irc_room
+		self.irc_room = irc_room.lower()
 		if hasattr(self.__class__, '_'+say_level):
 			self.say_level = getattr(self.__class__, '_'+say_level)
 		else: