From 7af54cc9be449af631d75d819a7ddd74ede37261 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 30 Mar 2026 05:48:58 -0400 Subject: Shave off a few more bytes, 5006 free now. --- src/irc.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/irc.c b/src/irc.c index 9034dfb..b4d9f43 100644 --- a/src/irc.c +++ b/src/irc.c @@ -514,6 +514,10 @@ static void invalid_msg(char type) { } #endif +static char cmd_is(const char *cmd) { + return streq_i(msg_cmd, cmd); +} + void select_screen(void) { char s; if(!msg_dest) { @@ -528,7 +532,7 @@ void select_screen(void) { } else { s = scr_getbyname(msg_src); if(!s) { - if(streq_i(msg_cmd, "PRIVMSG")) { /* or maybe NOTICE? */ + if(cmd_is("PRIVMSG")) { /* or maybe NOTICE? */ strncpy(last_pm_nick, msg_src, 32); comp_add_pm_nick(last_pm_nick); s = SCR_PRIV; @@ -546,26 +550,26 @@ static void dispatch_msg(void) { select_screen(); new_scr_status = SCR_OTHER; - if(streq_i(msg_cmd, "PRIVMSG")) { + if(cmd_is("PRIVMSG")) { new_scr_status = SCR_ACTIVE; do_privmsg(); - } else if(streq_i(msg_cmd, "NOTICE")) { + } else if(cmd_is("NOTICE")) { do_notice(); - } else if(streq_i(msg_cmd, "JOIN")) { + } else if(cmd_is("JOIN")) { do_join(); - } else if(streq_i(msg_cmd, "NICK")) { + } else if(cmd_is("NICK")) { do_nick(); - } else if(streq_i(msg_cmd, "QUIT")) { + } else if(cmd_is("QUIT")) { do_quit(); - } else if(streq_i(msg_cmd, "PART")) { + } else if(cmd_is("PART")) { do_part(); - } else if(streq_i(msg_cmd, "TOPIC")) { + } else if(cmd_is("TOPIC")) { do_topic(); - } else if(streq_i(msg_cmd, "KICK")) { + } else if(cmd_is("KICK")) { do_kick(); - } else if(streq_i(msg_cmd, "MODE")) { + } else if(cmd_is("MODE")) { do_mode(); - } else if(streq_i(msg_cmd, "PONG")) { + } else if(cmd_is("PONG")) { if(*msg_text == 'A') { return; /* do not set screen status */ } else { -- cgit v1.2.3