diff --git a/src/plugins/plugin_exp_pubsub_schema.py b/src/plugins/plugin_exp_pubsub_schema.py index a473f4ef..8269d0ff 100755 --- a/src/plugins/plugin_exp_pubsub_schema.py +++ b/src/plugins/plugin_exp_pubsub_schema.py @@ -34,7 +34,6 @@ from collections import Iterable 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 @@ class PubsubSchema(object): 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):