mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-08-28 11:54:23 +00:00
fix(nomadnet): convert file download backtick params to var_ dict, fix cancel crash
This commit is contained in:
@@ -14080,6 +14080,10 @@ class ReticulumMeshChat:
|
||||
destination_hash_hex = download_data.get("destination_hash")
|
||||
file_path = download_data.get("file_path")
|
||||
request_data = download_data.get("data")
|
||||
if isinstance(request_data, str):
|
||||
request_data = convert_nomadnet_string_data_to_map(request_data)
|
||||
elif request_data is None:
|
||||
request_data = {}
|
||||
|
||||
if not destination_hash_hex or not file_path:
|
||||
return
|
||||
@@ -15506,7 +15510,9 @@ class ReticulumMeshChat:
|
||||
except Exception as e:
|
||||
print(f"_lxmf_reticulum_enforce_block: failed: {e}")
|
||||
|
||||
def _delete_contact_and_stamp_ticket(self, destination_hash: str, context=None) -> None:
|
||||
def _delete_contact_and_stamp_ticket(
|
||||
self, destination_hash: str, context=None
|
||||
) -> None:
|
||||
"""Remove contact and stamp/ticket state for a blocked destination."""
|
||||
ctx = context or self.current_context
|
||||
if not ctx or not ctx.database:
|
||||
|
||||
@@ -107,7 +107,22 @@ class NomadnetDownloader:
|
||||
|
||||
if self.request_receipt is not None:
|
||||
try:
|
||||
self.request_receipt.cancel()
|
||||
if (
|
||||
hasattr(self.request_receipt, "resource")
|
||||
and self.request_receipt.resource is not None
|
||||
):
|
||||
self.request_receipt.resource.cancel()
|
||||
else:
|
||||
self.request_receipt.status = RNS.RequestReceipt.FAILED
|
||||
if (
|
||||
hasattr(self.request_receipt, "link")
|
||||
and self.request_receipt.link is not None
|
||||
and self.request_receipt
|
||||
in self.request_receipt.link.pending_requests
|
||||
):
|
||||
self.request_receipt.link.pending_requests.remove(
|
||||
self.request_receipt
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"Failed to cancel request: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user