changeset 200:740effa74c18

bugfix for previous commit, forgot "self" argument for say_on_XMPP_through_bridge Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Thu, 25 Feb 2010 20:42:34 +0100
parents dcabe54deeba
children de574314990e
files bot.py participant.py
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bot.py
+++ b/bot.py
@@ -286,6 +286,11 @@ class Bot(threading.Thread):
 						return
 					
 				return
+		
+		if self.debug:
+			self.error(1, 'presence was not handled', debug=True)
+		else:
+			self.error(say_levels.debug, 'Unhandled XMPP presence:\n'+message.__str__(fancy=1))
 	
 	
 	def _xmpp_iq_handler(self, dispatcher, iq):
@@ -427,13 +432,13 @@ class Bot(threading.Thread):
 										self.error(say_levels.error, 'Not allowed to speak on the XMPP MUC of bridge '+str(b)+', stopping it', send_to_admins=True)
 										b.stop(message='Not allowed to speak on the XMPP MUC, stopping the bridge')
 									else:
-										self.error(2, 'recevied unknown error message\n'+message.__str__(fancy=1), debug=True)
+										self.error(say_levels.debug, 'recevied unknown error message\n'+message.__str__(fancy=1))
 					return
 			
-			self.error(2, 'recevied unknown error message\n'+message.__str__(fancy=1), debug=True)
+			self.error(say_levels.debug, 'received unknown error message\n'+message.__str__(fancy=1))
 		
 		else:
-			self.error(2, 'Received XMPP message of unknown type "'+str(message.getType())+'".\n'+message.__str__(fancy=1), debug=True)
+			self.error(say_levels.debug, 'Received XMPP message of unknown type "'+str(message.getType())+'".\n'+message.__str__(fancy=1))
 	
 	
 	def _irc_event_handler(self, connection, event):
--- a/participant.py
+++ b/participant.py
@@ -316,7 +316,7 @@ class Participant:
 			self.say_on_XMPP_through_bridge(message)
 	
 	
-	def say_on_XMPP_through_bridge(message):
+	def say_on_XMPP_through_bridge(self, message):
 		if message[:4] == '/me ':
 			self.bridge.say(-1, '* '+self.nickname+' '+message[4:], on_irc=False)
 		else: