From f7f5acbbe2a848d2c827aed0fe8410e48300c1e9 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Fri, 2 Oct 2020 19:38:37 -0400 Subject: Double up /help for server help While the automatic search via LESS is neat, I don't think it's very useful. Just always open the manual to the COMMANDS section, and fix it to append to LESS rather than replace it. --- handle.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'handle.c') diff --git a/handle.c b/handle.c index 7519b87..988aeb2 100644 --- a/handle.c +++ b/handle.c @@ -302,6 +302,18 @@ static void handleErrorNoMOTD(struct Message *msg) { (void)msg; } +static void handleReplyHelp(struct Message *msg) { + require(msg, false, 3); + if (!replies.help) return; + urlScan(Network, msg->nick, msg->params[2]); + uiWrite(Network, Warm, tagTime(msg), msg->params[2]); +} + +static void handleReplyEndOfHelp(struct Message *msg) { + (void)msg; + if (replies.help) replies.help--; +} + static void handleJoin(struct Message *msg) { require(msg, true, 1); uint id = idFor(msg->params[0]); @@ -1253,6 +1265,9 @@ static const struct Handler { { "478", handleErrorBanListFull }, { "482", handleErrorChanopPrivsNeeded }, { "671", handleReplyWhoisGeneric }, + { "704", handleReplyHelp }, + { "705", handleReplyHelp }, + { "706", handleReplyEndOfHelp }, { "900", handleReplyLoggedIn }, { "904", handleErrorSASLFail }, { "905", handleErrorSASLFail }, -- cgit 1.4.1-2-gfad0