From b14c2964b474d85f10ef0c20b6e16f331fc59b06 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 16 Apr 2019 15:23:12 -0700 Subject: [PATCH] modules/console: Add events__in dispatcher convenience cmd. --- modules/console.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index c9edc3947..d73977b53 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -5790,6 +5790,31 @@ console_cmd__events__in__origin(opt &out, const string_view &line) return true; } +bool +console_cmd__events__in(opt &out, const string_view &line) +{ + const params param{line, " ", + { + "what" + }}; + + const string_view &what + { + param.at("what") + }; + + if(valid(m::id::USER, what)) + return console_cmd__events__in__sender(out, line); + + if(rfc3986::valid_host(std::nothrow, what)) + return console_cmd__events__in__origin(out, line); + + throw error + { + "Cannot interpret type of argument '%s'", what + }; +} + conf::item events_dump_buffer_size {