Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0071.py @ 4051:c23cad65ae99
core: renamed `messageReceived` trigger to `message_received`
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 29 May 2023 13:32:08 +0200 |
parents | 524856bd7b19 |
children |
comparison
equal
deleted
inserted
replaced
4050:199473ffe4ea | 4051:c23cad65ae99 |
---|---|
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.message_received_trigger) | 103 host.trigger.add("message_received", self.message_received_trigger) |
104 host.trigger.add("sendMessage", self.send_message_trigger) | 104 host.trigger.add("sendMessage", self.send_message_trigger) |
105 | 105 |
106 def get_handler(self, client): | 106 def get_handler(self, client): |
107 return XEP_0071_handler(self) | 107 return XEP_0071_handler(self) |
108 | 108 |
109 def _message_post_treat(self, data, message_elt, body_elts, client): | 109 def _message_post_treat(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 message_received 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 |