diff --git a/aprsd/plugin.py b/aprsd/plugin.py index 1969af2..9e69103 100644 --- a/aprsd/plugin.py +++ b/aprsd/plugin.py @@ -31,6 +31,7 @@ CORE_PLUGINS = [ "aprsd.plugin.FortunePlugin", "aprsd.plugin.LocationPlugin", "aprsd.plugin.PingPlugin", + "aprsd.plugin.QueryPlugin", "aprsd.plugin.TimePlugin", "aprsd.plugin.WeatherPlugin", "aprsd.plugin.VersionPlugin", @@ -353,6 +354,22 @@ class PingPlugin(APRSDPluginBase): return reply.rstrip() +class QueryPlugin(APRSDPluginBase): + """Query command.""" + + version = "1.0" + command_regex = r"^\?.*" + command_name = "query" + + def command(self, fromcall, message, ack): + LOG.info("Query COMMAND") + + tracker = messaging.MsgTrack() + reply = "Pending Messages ({})".format(len(tracker)) + + return reply + + class TimePlugin(APRSDPluginBase): """Time command."""