diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py index 2c6b1f6..ec1122f 100644 --- a/meshchatx/meshchat.py +++ b/meshchatx/meshchat.py @@ -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: diff --git a/meshchatx/src/backend/nomadnet_downloader.py b/meshchatx/src/backend/nomadnet_downloader.py index bd5e5ff..8b9ff6d 100644 --- a/meshchatx/src/backend/nomadnet_downloader.py +++ b/meshchatx/src/backend/nomadnet_downloader.py @@ -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}")