degesch: add a /squery command for IRCnet

This commit is contained in:
Přemysl Eric Janouch 2021-05-22 19:38:20 +02:00
parent 1ba59e6ee0
commit 735096d76d
Signed by: p
GPG Key ID: A0420B94F92B9493
2 changed files with 22 additions and 0 deletions

5
NEWS
View File

@ -1,3 +1,8 @@
1.2.0 (202?-??-??) "There Are Other Countries As Well"
* degesch: added a /squery command for IRCnet
1.1.0 (2020-10-31) "What Do You Mean By 'This Isn't Germany'?" 1.1.0 (2020-10-31) "What Do You Mean By 'This Isn't Germany'?"
* degesch: made fancy-prompt.lua work with libedit * degesch: made fancy-prompt.lua work with libedit

View File

@ -11249,6 +11249,20 @@ handle_command_notice (struct handler_args *a)
return true; return true;
} }
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 static bool
handle_command_ctcp (struct handler_args *a) handle_command_ctcp (struct handler_args *a)
{ {
@ -11864,6 +11878,9 @@ g_command_handlers[] =
{ "notice", "Send notice to a nick or channel", { "notice", "Send notice to a nick or channel",
"<target> <message>", "<target> <message>",
handle_command_notice, HANDLER_SERVER | HANDLER_NEEDS_REG }, 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", { "ctcp", "Send a CTCP query",
"<target> <tag>", "<target> <tag>",
handle_command_ctcp, HANDLER_SERVER | HANDLER_NEEDS_REG }, handle_command_ctcp, HANDLER_SERVER | HANDLER_NEEDS_REG },