comparison sat/memory/disco.py @ 3750:193b56ef58e0

core (disco): use new `client.server_jid` property in `getItems`
author Goffi <goffi@goffi.org>
date Fri, 13 May 2022 17:55:51 +0200
parents 16e36f0dd1cb
children 073f386a191a
comparison
equal deleted inserted replaced
3749:9581098b64f0 3750:193b56ef58e0
256 @param jid_(jid.JID): jid of the target, or None for profile's server 256 @param jid_(jid.JID): jid of the target, or None for profile's server
257 @param node(unicode): optional node to use for disco request 257 @param node(unicode): optional node to use for disco request
258 @param use_cache(bool): if True, use cached data if available 258 @param use_cache(bool): if True, use cached data if available
259 @return: a Deferred which fire disco.DiscoItems 259 @return: a Deferred which fire disco.DiscoItems
260 """ 260 """
261 server_jid = jid.JID(client.jid.host)
262 if jid_ is None: 261 if jid_ is None:
263 jid_ = server_jid 262 jid_ = client.server_jid
264 263
265 if jid_ == server_jid and not node: 264 if jid_ == client.server_jid and not node:
266 # we cache items only for our own server and if node is not set 265 # we cache items only for our own server and if node is not set
267 try: 266 try:
268 items = self.host.memory.getEntityData( 267 items = self.host.memory.getEntityData(
269 client, jid_, ["DISCO_ITEMS"] 268 client, jid_, ["DISCO_ITEMS"]
270 )["DISCO_ITEMS"] 269 )["DISCO_ITEMS"]