comparison twisted/plugins/pubsub.py @ 431:5e8b8ef5c862

implentation of XEP-0346 (Form Discovery and Publishing): The former non standard node schema has been replaced by XEP-0346 which uses 2 nodes (one from schema/template and one for submitted values). The implementation is an adapation of the former one, and data validation is still done even if this is not currently specified in any XEP. When the template node is modified, the change is reflected in the node schema.
author Goffi <goffi@goffi.org>
date Fri, 11 Dec 2020 17:19:00 +0100
parents 5a0ada3b61ca
children 36c9fb677f1d
comparison
equal deleted inserted replaced
430:5a0ada3b61ca 431:5e8b8ef5c862
212 from wokkel import mam 212 from wokkel import mam
213 from sat_pubsub import const 213 from sat_pubsub import const
214 from sat_pubsub import mam as pubsub_mam 214 from sat_pubsub import mam as pubsub_mam
215 from sat_pubsub import pubsub_admin 215 from sat_pubsub import pubsub_admin
216 from sat_pubsub.backend import BackendService, ExtraDiscoHandler 216 from sat_pubsub.backend import BackendService, ExtraDiscoHandler
217 from sat_pubsub.schema import SchemaHandler
218 from sat_pubsub.privilege import PrivilegesHandler 217 from sat_pubsub.privilege import PrivilegesHandler
219 from sat_pubsub.delegation import DelegationsHandler 218 from sat_pubsub.delegation import DelegationsHandler
220 219
221 if not config['jid'] or not config['xmpp_pwd']: 220 if not config['jid'] or not config['xmpp_pwd']:
222 raise usage.UsageError("You must specify jid and xmpp_pwd") 221 raise usage.UsageError("You must specify jid and xmpp_pwd")
291 mam_s.setHandlerParent(cs) 290 mam_s.setHandlerParent(cs)
292 291
293 pa = pubsub_admin.PubsubAdminHandler(bs) 292 pa = pubsub_admin.PubsubAdminHandler(bs)
294 pa.setHandlerParent(cs) 293 pa.setHandlerParent(cs)
295 294
296 sh = SchemaHandler()
297 sh.setHandlerParent(cs)
298
299 # wokkel.pubsub doesn't handle non pubsub# disco 295 # wokkel.pubsub doesn't handle non pubsub# disco
300 # and we need to announce other feature, so this is a workaround 296 # and we need to announce other feature, so this is a workaround
301 # to add them 297 # to add them
302 # FIXME: propose a patch upstream to fix this situation 298 # FIXME: propose a patch upstream to fix this situation
303 ed = ExtraDiscoHandler() 299 ed = ExtraDiscoHandler()