diff options
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tabs.py b/src/tabs.py index b7624c2b..53115716 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -39,6 +39,7 @@ import string import common import core import singleton +import xhtml import multiuserchat as muc @@ -270,7 +271,8 @@ class ChatTab(Tab): def on_enter(self): txt = self.input.key_enter() - if not self.execute_command(txt): + clean_text = xhtml.clean_text(txt) + if not self.execute_command(clean_text): if txt.startswith('//'): txt = txt[1:] self.command_say(txt) @@ -556,7 +558,11 @@ class MucTab(ChatTab): def command_say(self, line): msg = self.core.xmpp.make_message(self.get_name()) msg['type'] = 'groupchat' - msg['body'] = line + if line.find('\x19') == -1: + msg['body'] = line + else: + msg['body'] = xhtml.clean_text(line) + msg['xhtml_im'] = xhtml.poezio_colors_to_html(line) if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates is not False: msg['chat_state'] = 'active' msg.send() |