comparison src/plugins/plugin_xep_0071.py @ 1813:cf53e3cc702a

plugin XEP-0071: removed cleanXHTML use for sent message: it's not necessary in this direction
author Goffi <goffi@goffi.org>
date Tue, 19 Jan 2016 12:08:38 +0100
parents 160b0d4c6520
children 2daf7b4c6756
comparison
equal deleted inserted replaced
1812:160b0d4c6520 1813:cf53e3cc702a
20 from sat.core.i18n import _ 20 from sat.core.i18n import _
21 from sat.core import exceptions 21 from sat.core import exceptions
22 from sat.core.log import getLogger 22 from sat.core.log import getLogger
23 log = getLogger(__name__) 23 log = getLogger(__name__)
24 24
25 from sat.tools import xml_tools
26 from wokkel import disco, iwokkel 25 from wokkel import disco, iwokkel
27 from zope.interface import implements 26 from zope.interface import implements
28 # from lxml import etree 27 # from lxml import etree
29 try: 28 try:
30 from lxml import html 29 from lxml import html
115 xhtml = mess_data['extra'].get('xhtml', '') 114 xhtml = mess_data['extra'].get('xhtml', '')
116 if rich: 115 if rich:
117 d = self.synt_plg.convert(rich, syntax, self.SYNTAX_XHTML_IM) 116 d = self.synt_plg.convert(rich, syntax, self.SYNTAX_XHTML_IM)
118 if xhtml: 117 if xhtml:
119 raise exceptions.DataError(_("Can't have xhtml and rich content at the same time")) 118 raise exceptions.DataError(_("Can't have xhtml and rich content at the same time"))
120 if xhtml:
121 d = self.synt_plg.cleanXHTML(xhtml)
122 d.addCallback(syntax_converted) 119 d.addCallback(syntax_converted)
123 return d 120 return d
124 121
125 def messageReceivedTrigger(self, message, post_treat, profile): 122 def messageReceivedTrigger(self, message, post_treat, profile):
126 """ Check presence of XHTML-IM in message 123 """ Check presence of XHTML-IM in message