# HG changeset patch # User Goffi # Date 1509119640 -7200 # Node ID 713cedc9975287d164ff926a4f21e475bc2b864b # Parent 7bfcc431f66d7c8f259e459ebde7474848bd0b67 plugin pubsub schema: allow any data_form schema: the schema is actually the schema needed for the items, so it should not in pubsub schema namespace. diff -r 7bfcc431f66d -r 713cedc99752 src/plugins/plugin_exp_pubsub_schema.py --- a/src/plugins/plugin_exp_pubsub_schema.py Fri Oct 27 08:36:24 2017 +0200 +++ b/src/plugins/plugin_exp_pubsub_schema.py Fri Oct 27 17:54:00 2017 +0200 @@ -34,7 +34,6 @@ import copy NS_SCHEMA = 'https://salut-a-toi/protocol/schema:0' -NS_SCHEMA_FORM = 'https://salut-a-toi/protocol/schema#schema:0' PLUGIN_INFO = { C.PI_NAME: "PubSub Schema", @@ -98,13 +97,11 @@ schema_elt = next(iq_elt.elements(NS_SCHEMA, 'schema')) except StopIteration: raise exceptions.DataError('missing element') - schema_form = data_form.findForm(schema_elt, NS_SCHEMA_FORM) - if schema_form is None: + try: + x_elt = next(schema_elt.elements((data_form.NS_X_DATA, 'x'))) + except StopIteration: # there is not schema on this node return None - # we get again the form because we need all elements/namespaces - # while schema_form.toElement while only keep XEP-0004 elements - x_elt = next(schema_elt.elements(data_form.NS_X_DATA, 'x')) return x_elt def getSchema(self, client, service, nodeIdentifier):