aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-30 05:48:58 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-30 05:48:58 -0400
commit7af54cc9be449af631d75d819a7ddd74ede37261 (patch)
tree045d6362de2fbab74ab557d7da3915447e6e83ad /src
parenta1b4788028889a4bf515de9b381fe64a97013606 (diff)
downloadfujinet-chat-7af54cc9be449af631d75d819a7ddd74ede37261.tar.gz
Shave off a few more bytes, 5006 free now.
Diffstat (limited to 'src')
-rw-r--r--src/irc.c26
1 files changed, 15 insertions, 11 deletions
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 {