From 3f393e5b8fd9a313d85295eea3ce4f92b6b4339a Mon Sep 17 00:00:00 2001 From: liamcottle Date: Mon, 23 Dec 2024 17:28:10 +1300 Subject: [PATCH] Revert "hook incoming rns packets" This reverts commit 2e81527478d5d239bdb52abb29053cdf3a4fcd87. --- meshchat.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/meshchat.py b/meshchat.py index 91bcc32..6c0428d 100644 --- a/meshchat.py +++ b/meshchat.py @@ -143,22 +143,6 @@ class ReticulumMeshChat: self.audio_call_manager = AudioCallManager(identity=self.identity) self.audio_call_manager.register_incoming_call_callback(self.on_incoming_audio_call) - # create a new implementation of RNS.Transport.packet_filter so we can intercept every incoming packet - original_packet_filter = RNS.Transport.packet_filter - def hooked_packet_filter(packet): - - # fire callback - try: - self.on_rns_packet(packet) - except: - pass - - # call original implementation - return original_packet_filter(packet) - - # hook original implementation - RNS.Transport.packet_filter = staticmethod(hooked_packet_filter) - # start background thread for auto announce loop thread = threading.Thread(target=asyncio.run, args=(self.announce_loop(),)) thread.daemon = True @@ -239,10 +223,6 @@ class ReticulumMeshChat: # wait 1 second before next loop await asyncio.sleep(1) - # called for every received packet - def on_rns_packet(self, packet: RNS.Packet): - print(f"on_rns_packet: {packet.get_hash().hex()}: snr={packet.get_snr()}, rssi={packet.get_rssi()}, link_quality={packet.get_q()}") - # uses the provided destination hash as the active propagation node def set_active_propagation_node(self, destination_hash: str | None):