summaryrefslogtreecommitdiff
path: root/src/xhtml.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-01-17 17:37:06 +0100
committermathieui <mathieui@mathieui.net>2013-01-17 17:37:06 +0100
commitc5cc462963363b2307a2a341da170829385a9589 (patch)
tree7a93dec042fef00865dab70320ed4cb8f560a9e9 /src/xhtml.py
parentb06240ee7b4940af52a0c01915214860d8a06bb2 (diff)
downloadpoezio-c5cc462963363b2307a2a341da170829385a9589.tar.gz
poezio-c5cc462963363b2307a2a341da170829385a9589.tar.bz2
poezio-c5cc462963363b2307a2a341da170829385a9589.tar.xz
poezio-c5cc462963363b2307a2a341da170829385a9589.zip
Move to the upstream SleekXMPP
- remove the decline command that is not in the trunk (and mediated declines are supported nowhere anyway) - change a bit xhtml-im support - change the bookmarks management a bit - Add a verification to avoid crashing when poezio will be launched the next time - Fix the (unrelated) bug when setting a jid affiliation
Diffstat (limited to 'src/xhtml.py')
-rw-r--r--src/xhtml.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xhtml.py b/src/xhtml.py
index a36607d2..1c9c20e7 100644
--- a/src/xhtml.py
+++ b/src/xhtml.py
@@ -191,7 +191,7 @@ def get_body_from_message_stanza(message):
the body (without any color) otherwise
"""
if config.get('enable_xhtml_im', 'true') == 'true':
- xhtml_body = message['xhtml_im']
+ xhtml_body = message['html']['body']
if xhtml_body:
content = xhtml_to_poezio_colors(xhtml_body)
content = content if content else message['body']
@@ -224,7 +224,7 @@ def ncurses_color_to_html(color):
r = g = b = color / 24 * 6
return '#%02X%02X%02X' % (r*256/6, g*256/6, b*256/6)
-def xhtml_to_poezio_colors(text):
+def xhtml_to_poezio_colors(xml):
def parse_css(css):
def get_color(value):
if value[0] == '#':
@@ -283,7 +283,6 @@ def xhtml_to_poezio_colors(text):
def trim(string):
return re.sub(whitespace_re, ' ', string)
- xml = ET.fromstring(text)
message = ''
if version_info[1] == 2:
elems = xml.iter()