Mercurial > xib
comparison participant.py @ 73:fa291fd20480
Handle /me the XMPP to IRC way
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Wed, 02 Sep 2009 15:08:34 +0200 |
parents | 6c4b841144f6 |
children | a8749705fe94 |
comparison
equal
deleted
inserted
replaced
72:6c4b841144f6 | 73:fa291fd20480 |
---|---|
147 | 147 |
148 def sayOnIRC(self, message): | 148 def sayOnIRC(self, message): |
149 try: | 149 try: |
150 if isinstance(self.irc_connection, ServerConnection): | 150 if isinstance(self.irc_connection, ServerConnection): |
151 try: | 151 try: |
152 self.irc_connection.privmsg(self.bridge.irc_room, message) | 152 if message[:4] == '/me ': |
153 self.irc_connection.action(self.bridge.irc_room, message[4:]) | |
154 else: | |
155 self.irc_connection.privmsg(self.bridge.irc_room, message) | |
153 except ServerNotConnectedError: | 156 except ServerNotConnectedError: |
154 self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) | 157 self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) |
155 elif not isinstance(self.xmpp_c, xmpp.client.Client): | 158 elif not isinstance(self.xmpp_c, xmpp.client.Client): |
156 self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) | 159 self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) |
157 except EncodingException: | 160 except EncodingException: |