Commit 47e5a523 authored by Yann Leboulanger's avatar Yann Leboulanger

[Zash] support latest version of XEP-0258. Fixes #7010

parent 861d3665
......@@ -2065,7 +2065,8 @@ class Connection(CommonConnection, ConnectionHandlers):
if not gajim.account_is_connected(self.name):
return
self.seclabel_catalogue_request(to, callback)
iq = common.xmpp.Iq(typ='get')
server = gajim.get_jid_from_account(self.name).split("@")[1] # Really, no better way?
iq = common.xmpp.Iq(typ='get', to=server)
iq2 = iq.addChild(name='catalog', namespace=common.xmpp.NS_SECLABEL_CATALOG)
iq2.setAttr('to', to)
self.connection.send(iq)
......
......@@ -1414,16 +1414,12 @@ ConnectionJingle, ConnectionIBBytestream):
log.debug('SecLabelCB')
query = iq_obj.getTag('catalog')
to = query.getAttr('to')
items = query.getTags('securitylabel')
items = query.getTags('item')
labels = {}
ll = []
for item in items:
display_tag = item.getTag('displaymarking')
if display_tag:
label = display_tag.getData()
else:
label = ''
labels[label] = item
label = item.getAttr('selector')
labels[label] = item.getTag('securitylabel')
ll.append(label)
if to not in self.seclabel_catalogues:
self.seclabel_catalogues[to] = [[], None, None]
......
......@@ -119,7 +119,7 @@ NS_RPC = 'jabber:iq:rpc' # XEP-0009
NS_RSM = 'http://jabber.org/protocol/rsm'
NS_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl'
NS_SECLABEL = 'urn:xmpp:sec-label:0'
NS_SECLABEL_CATALOG = 'urn:xmpp:sec-label:catalog:0'
NS_SECLABEL_CATALOG = 'urn:xmpp:sec-label:catalog:2'
NS_SEARCH = 'jabber:iq:search'
NS_SERVER = 'jabber:server'
NS_SESSION = 'urn:ietf:params:xml:ns:xmpp-session'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment