comparison sat/plugins/plugin_xep_0470.py @ 3993:722c25818778

plugin XEP-0470: create a default configuration if node config can't be accessed
author Goffi <goffi@goffi.org>
date Mon, 05 Dec 2022 11:54:47 +0100
parents 3cb9ade2ab84
children 524856bd7b19
comparison
equal deleted inserted replaced
3992:1c84268752a1 3993:722c25818778
192 # we auto-create the missing node 192 # we auto-create the missing node
193 await self._p.createNode( 193 await self._p.createNode(
194 client, service, node 194 client, service, node
195 ) 195 )
196 node_config = await self._p.getConfiguration(client, service, node) 196 node_config = await self._p.getConfiguration(client, service, node)
197 elif e.condition == "forbidden":
198 node_config = self._p.make_configuration_form({})
197 else: 199 else:
198 raise e 200 raise e
199 try: 201 try:
200 # FIXME: check if this is the best publish_model option 202 # FIXME: check if this is the best publish_model option
201 node_config.fields["pubsub#publish_model"].value = "open" 203 node_config.fields["pubsub#publish_model"].value = "open"