Mercurial > xib
comparison participant.py @ 192:12fa9bb73b1d
check connection in Bridge.say(), use Bridge.say() in Participant.sayOn{IRC,XMPP}()
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 21 Feb 2010 14:51:14 +0100 |
parents | e04410e7e527 |
children | 4a379eb359dd |
comparison
equal
deleted
inserted
replaced
191:ac89a4a72a62 | 192:12fa9bb73b1d |
---|---|
292 bot_say = True | 292 bot_say = True |
293 elif not isinstance(self.xmpp_c, xmpp.client.Client): | 293 elif not isinstance(self.xmpp_c, xmpp.client.Client): |
294 bot_say = True | 294 bot_say = True |
295 if bot_say: | 295 if bot_say: |
296 if action: | 296 if action: |
297 self.bridge.irc_connection.privmsg(self.bridge.irc_room, '* '+self.nickname+' '+message) | 297 self.bridge.say('* '+self.nickname+' '+message, on_xmpp=False) |
298 else: | 298 else: |
299 self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) | 299 self.bridge.say('<'+self.nickname+'> '+message, on_xmpp=False) |
300 | 300 |
301 | 301 |
302 def sayOnIRCTo(self, to, message): | 302 def sayOnIRCTo(self, to, message): |
303 if isinstance(self.irc_connection, ServerConnection): | 303 if isinstance(self.irc_connection, ServerConnection): |
304 self.irc_connection.privmsg(to, message) | 304 self.irc_connection.privmsg(to, message) |
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 if message[:4] == '/me ': |
317 self.bridge.xmpp_room.say('* '+self.nickname+' '+message[4:]) | 317 self.bridge.say('* '+self.nickname+' '+message[4:], on_irc=False) |
318 else: | 318 else: |
319 self.bridge.xmpp_room.say('<'+self.nickname+'> '+message) | 319 self.bridge.say('<'+self.nickname+'> '+message, on_irc=False) |
320 | 320 |
321 | 321 |
322 def sayOnXMPPTo(self, to, message): | 322 def sayOnXMPPTo(self, to, message): |
323 if isinstance(self.xmpp_c, xmpp.client.Client): | 323 if isinstance(self.xmpp_c, xmpp.client.Client): |
324 self.muc.sayTo(to, message) | 324 self.muc.sayTo(to, message) |