comparison src/plugins/plugin_xep_0071.py @ 922:c897c8d321b3

core: sendMessageTrigger now manage pre and post treatments, which happen before or after XML generation
author Goffi <goffi@goffi.org>
date Sat, 22 Mar 2014 15:34:05 +0100
parents c4b22aedb7d7
children 301b342c697a
comparison
equal deleted inserted replaced
921:8dd168c7741c 922:c897c8d321b3
128 except StopIteration: 128 except StopIteration:
129 # No XHTML-IM 129 # No XHTML-IM
130 pass 130 pass
131 return True 131 return True
132 132
133 def sendMessageTrigger(self, mess_data, treatments, profile): 133 def sendMessageTrigger(self, mess_data, pre_xml_treatments, post_xml_treatments, profile):
134 """ Check presence of rich text in extra 134 """ Check presence of rich text in extra
135 """ 135 """
136 if 'rich' in mess_data['extra'] or 'xhtml' in mess_data['extra']: 136 if 'rich' in mess_data['extra'] or 'xhtml' in mess_data['extra']:
137 treatments.addCallback(self._sendMessageAddRich, profile) 137 post_xml_treatments.addCallback(self._sendMessageAddRich, profile)
138 return True 138 return True
139 139
140 def _purgeStyle(self, styles_raw): 140 def _purgeStyle(self, styles_raw):
141 """ Remove unauthorised styles according to the XEP-0071 141 """ Remove unauthorised styles according to the XEP-0071
142 @param styles_raw: raw styles (value of the style attribute) 142 @param styles_raw: raw styles (value of the style attribute)