From 6f652230b0b8096045ec5ebaa151e8029dad8d38 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 4 Apr 2025 12:00:09 -0700 Subject: [PATCH] fixQRZ formatting and enhance saving names without info packet --- README.md | 2 +- mesh_bot.py | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 349c45f..6e249c0 100644 --- a/README.md +++ b/README.md @@ -466,7 +466,7 @@ I used ideas and snippets from other responder bots and want to call them out! - **Josh**: For more bashing on installer! - **dj505**: trying it on windows! - **mikecarper**: ideas, and testing. hamtest -- **Cisien, bitflip, **Woof**, **propstg**, **Josh** and Hailo1999**: For testing and feature ideas on Discord and GitHub. +- **Cisien, bitflip, **Woof**, **propstg**, **trs2982**, **Josh** and Hailo1999**: For testing and feature ideas on Discord and GitHub. - **Meshtastic Discord Community**: For tossing out ideas and testing code. ### Tools diff --git a/mesh_bot.py b/mesh_bot.py index 1069046..8c2f8b5 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1341,14 +1341,18 @@ def onReceive(packet, interface): # if QRZ enabled check if we have said hello if qrz_hello_enabled: if never_seen_before(message_from_id): - name = {get_name_from_number(message_from_id, 'short', rxNode)} - # add to qrz_hello list - hello(message_from_id, name) - # send a hello message as a DM - if not train_qrz: - time.sleep(responseDelay) - send_message(f"Hello {name} {qrz_hello_string}", channel_number, message_from_id, rxNode) - time.sleep(responseDelay) + name = get_name_from_number(message_from_id, 'short', rxNode) + if isinstance(name, str) and name.startswith("!") and len(name) == 9: + # we didnt get a info packet yet so wait and ingore this go around + logger.debug(f"System: QRZ Hello ignored, no info packet yet") + else: + # add to qrz_hello list + hello(message_from_id, name) + # send a hello message as a DM + if not train_qrz: + time.sleep(responseDelay) + send_message(f"Hello {name} {qrz_hello_string}", channel_number, message_from_id, rxNode) + time.sleep(responseDelay) else: # Evaluate non TEXT_MESSAGE_APP packets consumeMetadata(packet, rxNode)