From 5fd76ba6f90f3d5c341f4ce7ca23560497e899a3 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Wed, 7 Sep 2022 12:40:40 +0200
Subject: xC: add a trivial /relay command
For there is otherwise no way of getting that information.
---
xC.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/xC.c b/xC.c
index e35cfc6..e7325e1 100644
--- a/xC.c
+++ b/xC.c
@@ -12054,6 +12054,23 @@ handle_command_plugin (struct handler_args *a)
return true;
}
+static bool
+handle_command_relay (struct handler_args *a)
+{
+ if (*a->arguments)
+ return false;
+
+ int len = 0;
+ LIST_FOR_EACH (struct client, c, a->ctx->clients)
+ len++;
+
+ if (a->ctx->relay_fd == -1)
+ log_global_status (a->ctx, "The relay is not enabled");
+ else
+ log_global_status (a->ctx, "The relay has #d clients", len);
+ return true;
+}
+
static bool
show_aliases_list (struct app_context *ctx)
{
@@ -12790,6 +12807,9 @@ g_command_handlers[] =
{ "plugin", "Manage plugins",
"list | load