Mercurial > xib
comparison participant.py @ 245:cf4f00441628
fix for Participant say_on_xmpp* functions, really check we are in the room before sending message
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Mon, 08 Mar 2010 18:30:13 +0100 |
parents | 5f1e9211af03 |
children | 303e571bc104 |
comparison
equal
deleted
inserted
replaced
244:9b83cdd51523 | 245:cf4f00441628 |
---|---|
313 else: | 313 else: |
314 self.bridge.get_participant(to).say_on_xmpp_to(self.nickname, 'XIB error: Sorry but you cannot send cross-protocol private messages because I don\'t have an IRC duplicate with your nickname.') | 314 self.bridge.get_participant(to).say_on_xmpp_to(self.nickname, 'XIB error: Sorry but you cannot send cross-protocol private messages because I don\'t have an IRC duplicate with your nickname.') |
315 | 315 |
316 | 316 |
317 def say_on_xmpp(self, message, action=False): | 317 def say_on_xmpp(self, message, action=False): |
318 if isinstance(self.xmpp_c, xmpp.client.Client): | 318 if self.muc.connected: |
319 self.muc.say(message, action=action) | 319 self.muc.say(message, action=action) |
320 elif not isinstance(self.irc_connection, ServerConnection): | 320 elif not isinstance(self.irc_connection, ServerConnection): |
321 self.bridge.say_on_behalf(self.nickname, message, 'xmpp', action=action) | 321 self.bridge.say_on_behalf(self.nickname, message, 'xmpp', action=action) |
322 | 322 |
323 | 323 |
324 def say_on_xmpp_to(self, to, message, action=False): | 324 def say_on_xmpp_to(self, to, message, action=False): |
325 if isinstance(self.xmpp_c, xmpp.client.Client): | 325 if self.muc.connected: |
326 self.muc.say_to(to, message, action=action) | 326 self.muc.say_to(to, message, action=action) |
327 elif not isinstance(self.irc_connection, ServerConnection): | 327 elif not isinstance(self.irc_connection, ServerConnection): |
328 if self.bridge.mode not in ['normal', 'bypass']: | 328 if self.bridge.mode not in ['normal', 'bypass']: |
329 self.bridge.get_participant(to).say_on_xmpp_to(self.nickname, 'XIB error: Sorry but cross-protocol private messages are disabled in '+self.bridge.mode+' mode.') | 329 self.bridge.get_participant(to).say_on_xmpp_to(self.nickname, 'XIB error: Sorry but cross-protocol private messages are disabled in '+self.bridge.mode+' mode.') |
330 else: | 330 else: |