comparison participant.py @ 199:dcabe54deeba

improved an XMPP error handling, created Participant.say_on_XMPP_through_bridge() Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Thu, 25 Feb 2010 18:41:55 +0100
parents 4a379eb359dd
children 740effa74c18
comparison
equal deleted inserted replaced
198:66ed2dcdc4d1 199:dcabe54deeba
311 311
312 def sayOnXMPP(self, message): 312 def sayOnXMPP(self, message):
313 if isinstance(self.xmpp_c, xmpp.client.Client): 313 if isinstance(self.xmpp_c, xmpp.client.Client):
314 self.muc.say(message) 314 self.muc.say(message)
315 elif not isinstance(self.irc_connection, ServerConnection): 315 elif not isinstance(self.irc_connection, ServerConnection):
316 if message[:4] == '/me ': 316 self.say_on_XMPP_through_bridge(message)
317 self.bridge.say(-1, '* '+self.nickname+' '+message[4:], on_irc=False) 317
318 else: 318
319 self.bridge.say(-1, '<'+self.nickname+'> '+message, on_irc=False) 319 def say_on_XMPP_through_bridge(message):
320 if message[:4] == '/me ':
321 self.bridge.say(-1, '* '+self.nickname+' '+message[4:], on_irc=False)
322 else:
323 self.bridge.say(-1, '<'+self.nickname+'> '+message, on_irc=False)
320 324
321 325
322 def sayOnXMPPTo(self, to, message): 326 def sayOnXMPPTo(self, to, message):
323 if isinstance(self.xmpp_c, xmpp.client.Client): 327 if isinstance(self.xmpp_c, xmpp.client.Client):
324 self.muc.sayTo(to, message) 328 self.muc.sayTo(to, message)