comparison sat/plugins/plugin_xep_0071.py @ 3172:dcebc585c29f

core: renamed "MessageReceived" trigger to "messageReceived" for consistency.
author Goffi <goffi@goffi.org>
date Tue, 18 Feb 2020 18:13:19 +0100
parents 559a625a236b
children be6d91572633
comparison
equal deleted inserted replaced
3171:d073d82d9044 3172:dcebc585c29f
98 self.SYNTAX_XHTML_IM, 98 self.SYNTAX_XHTML_IM,
99 lambda xhtml: xhtml, 99 lambda xhtml: xhtml,
100 self.XHTML2XHTML_IM, 100 self.XHTML2XHTML_IM,
101 [self._s.OPT_HIDDEN], 101 [self._s.OPT_HIDDEN],
102 ) 102 )
103 host.trigger.add("MessageReceived", self.messageReceivedTrigger) 103 host.trigger.add("messageReceived", self.messageReceivedTrigger)
104 host.trigger.add("sendMessage", self.sendMessageTrigger) 104 host.trigger.add("sendMessage", self.sendMessageTrigger)
105 105
106 def getHandler(self, client): 106 def getHandler(self, client):
107 return XEP_0071_handler(self) 107 return XEP_0071_handler(self)
108 108
109 def _messagePostTreat(self, data, message_elt, body_elts, client): 109 def _messagePostTreat(self, data, message_elt, body_elts, client):
110 """Callback which manage the post treatment of the message in case of XHTML-IM found 110 """Callback which manage the post treatment of the message in case of XHTML-IM found
111 111
112 @param data: data send by MessageReceived trigger through post_treat deferred 112 @param data: data send by messageReceived trigger through post_treat deferred
113 @param message_elt: whole <message> stanza 113 @param message_elt: whole <message> stanza
114 @param body_elts: XHTML-IM body elements found 114 @param body_elts: XHTML-IM body elements found
115 @return: the data with the extra parameter updated 115 @return: the data with the extra parameter updated
116 """ 116 """
117 # TODO: check if text only body is empty, then try to convert XHTML-IM to pure text and show a warning message 117 # TODO: check if text only body is empty, then try to convert XHTML-IM to pure text and show a warning message