# HG changeset patch # User souliane # Date 1441195066 -7200 # Node ID ec60682a9d175f89febdc178cd7b1c7bbe12ea49 # Parent 84250128e42595c220232c949c1870628c5684fe plugin XEP-0055: display the search results using XMLUI JidsListWidget diff -r 84250128e425 -r ec60682a9d17 src/plugins/plugin_xep_0055.py --- a/src/plugins/plugin_xep_0055.py Wed Sep 02 13:56:34 2015 +0200 +++ b/src/plugins/plugin_xep_0055.py Wed Sep 02 13:57:46 2015 +0200 @@ -261,7 +261,18 @@ @param elt (domish.Element): form result element """ if [child for child in elt.children if child.name == "item"]: - xml_tools.dataFormResult2AdvancedList(main_ui, elt) + headers, xmlui_data = xml_tools.dataFormResult2XMLUIData(elt) + if "jid" in headers: # use XMLUI JidsListWidget to display the results + values = {} + for i in range(len(xmlui_data)): + header = headers.keys()[i % len(headers)] + widget_type, widget_args, widget_kwargs = xmlui_data[i] + value = widget_args[0] + values.setdefault(header, []).append(jid.JID(value) if header == "jid" else value) + main_ui.addJidsList(jids=values["jid"], name=D_(u"Search results")) + # TODO: also display the values other than JID + else: + xml_tools.XMLUIData2AdvancedList(main_ui, headers, xmlui_data) else: main_ui.addText(D_("The search gave no result"))