mirror of
https://github.com/craigerl/aprsd.git
synced 2025-09-04 06:07:48 -04:00
update query plugin to resend last N messages. syntax: ?rN
This commit is contained in:
parent
1ce2a56140
commit
d9141dc2d0
@ -22,6 +22,21 @@ class QueryPlugin(plugin.APRSDPluginBase):
|
|||||||
searchstring = "^" + self.config["ham"]["callsign"] + ".*"
|
searchstring = "^" + self.config["ham"]["callsign"] + ".*"
|
||||||
# only I can do admin commands
|
# only I can do admin commands
|
||||||
if re.search(searchstring, fromcall):
|
if re.search(searchstring, fromcall):
|
||||||
|
|
||||||
|
# resend last N most recent
|
||||||
|
r = re.search(r"^\?[rR]([0-9]).*", message)
|
||||||
|
if r is not None:
|
||||||
|
if len(tracker) > 0:
|
||||||
|
last_n = r.group(1)
|
||||||
|
reply = messaging.NULL_MESSAGE
|
||||||
|
LOG.debug(reply)
|
||||||
|
tracker.restart_delayed(count=int(last_n))
|
||||||
|
else:
|
||||||
|
reply = "No delayed msgs to resend"
|
||||||
|
LOG.debug(reply)
|
||||||
|
return reply
|
||||||
|
|
||||||
|
# resend all
|
||||||
r = re.search(r"^\?[rR].*", message)
|
r = re.search(r"^\?[rR].*", message)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
if len(tracker) > 0:
|
if len(tracker) > 0:
|
||||||
@ -29,7 +44,7 @@ class QueryPlugin(plugin.APRSDPluginBase):
|
|||||||
LOG.debug(reply)
|
LOG.debug(reply)
|
||||||
tracker.restart_delayed()
|
tracker.restart_delayed()
|
||||||
else:
|
else:
|
||||||
reply = "No Delayed Msgs"
|
reply = "No delayed msgs"
|
||||||
LOG.debug(reply)
|
LOG.debug(reply)
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user