Fix further errors.

This commit is contained in:
Schimon Jehudah, Adv. 2024-11-17 18:56:05 +02:00
parent 9e4d6f0d32
commit 519c277ea6

View file

@ -1393,7 +1393,7 @@ class HttpInstance:
'name' : name, 'name' : name,
'instances' : instances} 'instances' : instances}
xmpp_instance = accounts[jabber_id] xmpp_instance = accounts[jabber_id]
payload = Syndication.create_rfc4287_entry(entry_new) payload = UtilitiesSyndication.create_rfc4287_entry(entry_new)
iq = await XmppPubsub.publish_node_item( iq = await XmppPubsub.publish_node_item(
xmpp_instance, jabber_id, node_id, item_id, payload) xmpp_instance, jabber_id, node_id, item_id, payload)
#await iq.send(timeout=15) #await iq.send(timeout=15)
@ -1747,9 +1747,9 @@ class HttpInstance:
if exist: if exist:
# TODO Perhaps adding a paragraph with "your tags" and "who else has tagged this link" # TODO Perhaps adding a paragraph with "your tags" and "who else has tagged this link"
# and keep the (5 item) limit. # and keep the (5 item) limit.
#entry = Syndication.extract_items(item_payload) #entry = UtilitiesSyndication.extract_items(item_payload)
# NOTE Display only 5 items, as all the other tags appear at the list of "Related tags". # NOTE Display only 5 items, as all the other tags appear at the list of "Related tags".
entry = Syndication.extract_items(item_payload, limit=True) entry = UtilitiesSyndication.extract_items(item_payload, limit=True)
if entry: if entry:
#url_hash = iq_item['id'] #url_hash = iq_item['id']
url_hash = UtilitiesCryptography.hash_url_to_md5(entry['link']) url_hash = UtilitiesCryptography.hash_url_to_md5(entry['link'])
@ -1913,7 +1913,7 @@ class HttpInstance:
message = 'Information for URL {}'.format(url) message = 'Information for URL {}'.format(url)
description = 'Bookmark properties' description = 'Bookmark properties'
xmpp_instance = accounts[jabber_id] xmpp_instance = accounts[jabber_id]
payload = Syndication.create_rfc4287_entry(entry) payload = UtilitiesSyndication.create_rfc4287_entry(entry)
# TODO Add try/except for IQ # TODO Add try/except for IQ
print('Publish item') print('Publish item')
# TODO Check. # TODO Check.
@ -2070,7 +2070,7 @@ class HttpInstance:
if exist: if exist:
# TODO Add a check: if iq_item['id'] == url_hash: # TODO Add a check: if iq_item['id'] == url_hash:
entries = [] entries = []
entry = Syndication.extract_items(item_payload) entry = UtilitiesSyndication.extract_items(item_payload)
instances = DatabaseSQLite.get_entry_instances_by_url_hash(db_file, url_hash) instances = DatabaseSQLite.get_entry_instances_by_url_hash(db_file, url_hash)
entry['instances'] = instances entry['instances'] = instances
entry['jid'] = jabber_id entry['jid'] = jabber_id
@ -2142,7 +2142,7 @@ class HttpInstance:
if exist: if exist:
# TODO Add a check: if iq_item['id'] == url_hash: # TODO Add a check: if iq_item['id'] == url_hash:
entries = [] entries = []
entry = Syndication.extract_items(item_payload) entry = UtilitiesSyndication.extract_items(item_payload)
instances = DatabaseSQLite.get_entry_instances_by_url_hash(db_file, url_hash) instances = DatabaseSQLite.get_entry_instances_by_url_hash(db_file, url_hash)
entry['instances'] = instances entry['instances'] = instances
entry['jid'] = jabber_id entry['jid'] = jabber_id
@ -2239,7 +2239,7 @@ class HttpInstance:
if exist: if exist:
path = 'edit' path = 'edit'
description = 'Edit an existing bookmark' description = 'Edit an existing bookmark'
entry = Syndication.extract_items(item_payload) entry = UtilitiesSyndication.extract_items(item_payload)
entry['instances'] = DatabaseSQLite.get_entry_instances_by_url_hash(db_file, url_hash) entry['instances'] = DatabaseSQLite.get_entry_instances_by_url_hash(db_file, url_hash)
print(jabber_id) print(jabber_id)
print(entry['tags']) print(entry['tags'])