comparison sat/plugins/plugin_xep_0115.py @ 2587:e70023e84974

core (disco): fixed disco capabilities (empty disco was used)
author Goffi <goffi@goffi.org>
date Tue, 22 May 2018 09:59:58 +0200
parents 26edcf3a30eb
children 56f94936df1e
comparison
equal deleted inserted replaced
2586:57c8c155192f 2587:e70023e84974
77 # hash generation 77 # hash generation
78 _infos = yield client.discoHandler.info(client.jid, client.jid, '') 78 _infos = yield client.discoHandler.info(client.jid, client.jid, '')
79 disco_infos = disco.DiscoInfo() 79 disco_infos = disco.DiscoInfo()
80 for item in _infos: 80 for item in _infos:
81 disco_infos.append(item) 81 disco_infos.append(item)
82 disco_infos = disco.DiscoInfo()
83 cap_hash = client._caps_hash = self.host.memory.disco.generateHash(disco_infos) 82 cap_hash = client._caps_hash = self.host.memory.disco.generateHash(disco_infos)
84 log.info("Our capability hash has been generated: [{cap_hash}]".format( 83 log.info(u"Our capability hash has been generated: [{cap_hash}]".format(
85 cap_hash = cap_hash)) 84 cap_hash = cap_hash))
86 log.debug("Generating capability domish.Element") 85 log.debug(u"Generating capability domish.Element")
87 c_elt = domish.Element((NS_ENTITY_CAPABILITY, 'c')) 86 c_elt = domish.Element((NS_ENTITY_CAPABILITY, 'c'))
88 c_elt['hash'] = 'sha-1' 87 c_elt['hash'] = 'sha-1'
89 c_elt['node'] = C.APP_URL 88 c_elt['node'] = C.APP_URL
90 c_elt['ver'] = cap_hash 89 c_elt['ver'] = cap_hash
91 client._caps_elt = c_elt 90 client._caps_elt = c_elt