Python : Fix an error upon failiure to achieve items of a Jabber ID (Thanks. ThUnD3r|Gr33n)

This commit is contained in:
Schimon Jehudah, Adv. 2024-10-15 20:37:46 +03:00
parent 899f87865d
commit cc1061ecf1

View file

@ -628,7 +628,7 @@ class FileUtilities:
async def cache_jid_data(jabber_id, password, jid_bare, node_name=None, item_id=None, alias=None):
count = title = ''
count = iq_disco_items_list = iq_disco_items_items_list = title = ''
jid_vcard = {
'name' : '',
'note' : '',
@ -675,6 +675,7 @@ class FileUtilities:
# TODO /d/pubsub.nicoco.fr/blog/urn-uuid-53e43061-1962-3112-bb8a-1473dca61719
jid_items = await XmppXep0030.get_jid_items(xmpp_instance, jid_bare)
if isinstance(jid_items['iq'], stanza.iq.Iq):
iq = jid_items['iq']
iq_disco_items = iq['disco_items']
iq_disco_items_items = iq_disco_items['items']
@ -774,7 +775,7 @@ class FileUtilities:
print('Node items')
nodes = {}
#if node_name and node_name in iq_disco_items_set:
if node_name and node_name in iq_disco_items_list:
if iq_disco_items_list and node_name and node_name in iq_disco_items_list:
action = 'Browse'
node_item_ids = await XmppXep0060.get_node_item_ids(xmpp_instance, jid_bare, node_name)
if isinstance(node_item_ids['iq'], stanza.iq.Iq):