summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-03-30 04:34:45 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-03-30 04:34:45 +0200
commit92e63829a699ec68e7dcc2185fb7393255342dd2 (patch)
treea7a217287d8124af9c4c9ecfed54d380c282da8f /src/tabs.py
parent51cebe7bdc24fbeecd6b4ed0bd87760b84a2ef3b (diff)
downloadpoezio-92e63829a699ec68e7dcc2185fb7393255342dd2.tar.gz
poezio-92e63829a699ec68e7dcc2185fb7393255342dd2.tar.bz2
poezio-92e63829a699ec68e7dcc2185fb7393255342dd2.tar.xz
poezio-92e63829a699ec68e7dcc2185fb7393255342dd2.zip
Finish colors support with xhtml (clean the elinks dump, handle the input etc)
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py10
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()