commit 5f6ef1cc97a507a0b8da260bb7cf290fd8b415f6
parent de8dc859614b4fc9acffb96776b5c7eb854aaf76
Author: hhvn <dev@hhvn.uk>
Date: Sun, 28 Nov 2021 21:47:23 +0000
commands.c: schedule /quote
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/commands.c b/commands.c
@@ -145,6 +145,8 @@ command_ping(struct Server *server, char *str) {
static void
command_quote(struct Server *server, char *str) {
+ char msg[512];
+
if (!str) {
ui_error("/quote requires argument", NULL);
return;
@@ -155,7 +157,12 @@ command_quote(struct Server *server, char *str) {
return;
}
- ircprintf(server, "%s\r\n", str);
+ if (server->status == ConnStatus_connected) {
+ ircprintf(server, "%s\r\n", str);
+ } else {
+ snprintf(msg, sizeof(msg), "%s\r\n", str);
+ schedule_push(server, "376" /* RPL_ENDOFMOTD */, msg);
+ }
}
static void