1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-07-02 17:05:18 -04:00

Webchat: Don't automatically fetch location KISS

this patch changes webchat to not call REPEAT automatically to fetch the
location of a remote callsign if the client is on kiss.
Only fetch the location if the user clicks the button to fetch the
location.
This commit is contained in:
Hemna 2024-11-26 10:00:59 -05:00
parent 8f3da961e7
commit e8ae3807db

View File

@ -38,7 +38,7 @@ socketio = None
# List of callsigns that we don't want to track/fetch their location # List of callsigns that we don't want to track/fetch their location
callsign_no_track = [ callsign_no_track = [
"REPEAT", "WB4BOR-11", "APDW16", "WXNOW", "WXBOT", "BLN0", "BLN1", "BLN2", "APDW16", "BLN0", "BLN1", "BLN2",
"BLN3", "BLN4", "BLN5", "BLN6", "BLN7", "BLN8", "BLN9", "BLN3", "BLN4", "BLN5", "BLN6", "BLN7", "BLN8", "BLN9",
] ]
@ -319,6 +319,7 @@ class WebChatProcessPacketThread(rx.APRSDProcessPacketThread):
elif ( elif (
from_call not in callsign_locations from_call not in callsign_locations
and from_call not in callsign_no_track and from_call not in callsign_no_track
and client_factory.create().transport() in [client.TRANSPORT_APRSIS, client.TRANSPORT_FAKE]
): ):
# We have to ask aprs for the location for the callsign # We have to ask aprs for the location for the callsign
# We send a message packet to wb4bor-11 asking for location. # We send a message packet to wb4bor-11 asking for location.
@ -377,6 +378,7 @@ def _get_transport(stats):
@flask_app.route("/location/<callsign>", methods=["POST"]) @flask_app.route("/location/<callsign>", methods=["POST"])
def location(callsign): def location(callsign):
LOG.debug(f"Fetch location for callsign {callsign}") LOG.debug(f"Fetch location for callsign {callsign}")
if not callsign in callsign_no_track:
populate_callsign_location(callsign) populate_callsign_location(callsign)
@ -542,6 +544,7 @@ class SendMessageNamespace(Namespace):
def on_get_callsign_location(self, data): def on_get_callsign_location(self, data):
LOG.debug(f"on_callsign_location {data}") LOG.debug(f"on_callsign_location {data}")
if data["callsign"] not in callsign_no_track:
populate_callsign_location(data["callsign"]) populate_callsign_location(data["callsign"])