plugin XEP-0060: getItems extra is now serialised dict
This commit is contained in:
parent
fcbbc2aeed
commit
f2a06bbcbf
1 changed files with 32 additions and 31 deletions
|
|
@ -118,7 +118,7 @@ class PubsubSchema(object):
|
|||
host.bridge.addMethod(
|
||||
"psItemsFormGet",
|
||||
".plugin",
|
||||
in_sign="ssssiassa{ss}s",
|
||||
in_sign="ssssiassss",
|
||||
out_sign="(asa{ss})",
|
||||
method=self._getDataFormItems,
|
||||
async_=True,
|
||||
|
|
@ -302,7 +302,7 @@ class PubsubSchema(object):
|
|||
return xml_tools.dataForm2dataDict(schema_form)
|
||||
|
||||
def _getDataFormItems(self, form_ns="", service="", node="", schema="", max_items=10,
|
||||
item_ids=None, sub_id=None, extra_dict=None,
|
||||
item_ids=None, sub_id=None, extra="",
|
||||
profile_key=C.PROF_KEY_NONE):
|
||||
client = self.host.getClient(profile_key)
|
||||
service = jid.JID(service) if service else None
|
||||
|
|
@ -313,7 +313,7 @@ class PubsubSchema(object):
|
|||
else:
|
||||
schema = None
|
||||
max_items = None if max_items == C.NO_LIMIT else max_items
|
||||
extra = self._p.parseExtra(extra_dict)
|
||||
extra = self._p.parseExtra(data_format.deserialise(extra))
|
||||
d = defer.ensureDeferred(
|
||||
self.getDataFormItems(
|
||||
client,
|
||||
|
|
@ -553,7 +553,7 @@ class PubsubSchema(object):
|
|||
|
||||
## Helper methods ##
|
||||
|
||||
def prepareBridgeGet(self, service, node, max_items, sub_id, extra_dict, profile_key):
|
||||
def prepareBridgeGet(self, service, node, max_items, sub_id, extra, profile_key):
|
||||
"""Parse arguments received from bridge *Get methods and return higher level data
|
||||
|
||||
@return (tuple): (client, service, node, max_items, extra, sub_id) usable for
|
||||
|
|
@ -566,12 +566,12 @@ class PubsubSchema(object):
|
|||
max_items = None if max_items == C.NO_LIMIT else max_items
|
||||
if not sub_id:
|
||||
sub_id = None
|
||||
extra = self._p.parseExtra(extra_dict)
|
||||
extra = self._p.parseExtra(extra)
|
||||
|
||||
return client, service, node, max_items, extra, sub_id
|
||||
|
||||
def _get(self, service="", node="", max_items=10, item_ids=None, sub_id=None,
|
||||
extra=None, default_node=None, form_ns=None, filters=None,
|
||||
extra="", default_node=None, form_ns=None, filters=None,
|
||||
profile_key=C.PROF_KEY_NONE):
|
||||
"""Bridge method to retrieve data from node with schema
|
||||
|
||||
|
|
@ -583,8 +583,7 @@ class PubsubSchema(object):
|
|||
"""
|
||||
if filters is None:
|
||||
filters = {}
|
||||
if extra is None:
|
||||
extra = {}
|
||||
extra = data_format.deserialise(extra)
|
||||
# XXX: Q&D way to get list for labels when displaying them, but text when we
|
||||
# have to modify them
|
||||
if C.bool(extra.get("labels_as_list", C.BOOL_FALSE)):
|
||||
|
|
|
|||
Loading…
Reference in a new issue