summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-05-22 19:38:20 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-05-28 04:06:27 +0200
commit735096d76d218776dde024c7aa4c48c0eef90d5c (patch)
tree8742048420b6030ef6ebc5429fef4c77efae90a7 /degesch.c
parent1ba59e6ee0fba182f1fbb3daeb4b91c65e4b3e6a (diff)
downloadxK-735096d76d218776dde024c7aa4c48c0eef90d5c.tar.gz
xK-735096d76d218776dde024c7aa4c48c0eef90d5c.tar.xz
xK-735096d76d218776dde024c7aa4c48c0eef90d5c.zip
degesch: add a /squery command for IRCnet
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index 09ea823..cbc13da 100644
--- a/degesch.c
+++ b/degesch.c
@@ -11250,6 +11250,20 @@ handle_command_notice (struct handler_args *a)
}
static bool
+handle_command_squery (struct handler_args *a)
+{
+ if (!*a->arguments)
+ return false;
+
+ char *target = cut_word (&a->arguments);
+ if (!*a->arguments)
+ log_server_error (a->s, a->s->buffer, "No text to send");
+ else
+ irc_send (a->s, "SQUERY %s :%s", target, a->arguments);
+ return true;
+}
+
+static bool
handle_command_ctcp (struct handler_args *a)
{
if (!*a->arguments)
@@ -11864,6 +11878,9 @@ g_command_handlers[] =
{ "notice", "Send notice to a nick or channel",
"<target> <message>",
handle_command_notice, HANDLER_SERVER | HANDLER_NEEDS_REG },
+ { "squery", "Send a message to a service",
+ "<service> <message>",
+ handle_command_squery, HANDLER_SERVER | HANDLER_NEEDS_REG },
{ "ctcp", "Send a CTCP query",
"<target> <tag>",
handle_command_ctcp, HANDLER_SERVER | HANDLER_NEEDS_REG },