Mercurial > xib
comparison muc.py @ 213:fbe40b397f67
created Bridge.say_on_behalf in order to avoid code repetition in participant.py
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sat, 06 Mar 2010 19:05:07 +0100 |
parents | 2a81c480439a |
children | 0c99d38b84b8 |
comparison
equal
deleted
inserted
replaced
212:aa03c7ca53cb | 213:fbe40b397f67 |
---|---|
107 xmpp_c.UnregisterHandler('presence', self._xmpp_presence_handler) | 107 xmpp_c.UnregisterHandler('presence', self._xmpp_presence_handler) |
108 if self.callback != None: | 108 if self.callback != None: |
109 self.callback(errors) | 109 self.callback(errors) |
110 | 110 |
111 | 111 |
112 def say(self, message): | 112 def say(self, message, action=False): |
113 """Say message in the room""" | 113 """Say message in the room""" |
114 self.xmpp_c.lock.acquire() | 114 self.xmpp_c.lock.acquire() |
115 if action: | |
116 message = '/me '+message | |
115 s = xmpp.protocol.Message(to=self.room_jid, typ='groupchat', body=message) | 117 s = xmpp.protocol.Message(to=self.room_jid, typ='groupchat', body=message) |
116 self._send(s) | 118 self._send(s) |
117 self.xmpp_c.lock.release() | 119 self.xmpp_c.lock.release() |
118 | 120 |
119 | 121 |