Handle ERROR

weechat-hashes
C. McEnroe 2020-02-05 23:27:43 -05:00
parent 839cc362a8
commit 3085779d86
1 changed files with 6 additions and 0 deletions

View File

@ -233,6 +233,11 @@ static void handlePing(struct Message *msg) {
ircFormat("PONG :%s\r\n", msg->params[0]); ircFormat("PONG :%s\r\n", msg->params[0]);
} }
static void handleError(struct Message *msg) {
require(msg, false, 1);
errx(EX_UNAVAILABLE, "%s", msg->params[0]);
}
static const struct Handler { static const struct Handler {
const char *cmd; const char *cmd;
Handler *fn; Handler *fn;
@ -248,6 +253,7 @@ static const struct Handler {
{ "906", handleErrorSASLFail }, { "906", handleErrorSASLFail },
{ "AUTHENTICATE", handleAuthenticate }, { "AUTHENTICATE", handleAuthenticate },
{ "CAP", handleCap }, { "CAP", handleCap },
{ "ERROR", handleError },
{ "JOIN", handleJoin }, { "JOIN", handleJoin },
{ "NOTICE", handlePrivmsg }, { "NOTICE", handlePrivmsg },
{ "PING", handlePing }, { "PING", handlePing },