Mercurial > xib
comparison muc.py @ 229:a434b73bde51
added optional "action" argument to Participant.say_on_xmpp_to and muc.say_to
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 07 Mar 2010 22:12:25 +0100 |
parents | 45065f6f674c |
children | 9b83cdd51523 |
comparison
equal
deleted
inserted
replaced
228:3c493741e53a | 229:a434b73bde51 |
---|---|
128 s = xmpp.protocol.Message(to=self.room_jid, typ='groupchat', body=message) | 128 s = xmpp.protocol.Message(to=self.room_jid, typ='groupchat', body=message) |
129 self._send(s) | 129 self._send(s) |
130 self.xmpp_c.lock.release() | 130 self.xmpp_c.lock.release() |
131 | 131 |
132 | 132 |
133 def say_to(self, to, message): | 133 def say_to(self, to, message, action=False): |
134 """Send a private message""" | 134 """Send a private message""" |
135 self.xmpp_c.lock.acquire() | 135 self.xmpp_c.lock.acquire() |
136 if action: | |
137 message = '/me '+message | |
136 s = xmpp.protocol.Message(to=self.room_jid+'/'+to, typ='chat', body=message) | 138 s = xmpp.protocol.Message(to=self.room_jid+'/'+to, typ='chat', body=message) |
137 self._send(s) | 139 self._send(s) |
138 self.xmpp_c.lock.release() | 140 self.xmpp_c.lock.release() |
139 | 141 |
140 | 142 |