From 79e826a028f4b4c62c0c16e20af1fb13a9636324 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 15 Jun 2006 14:22:17 +0200 Subject: Converted irc->status to binary flags. (This also fixes auto-save-on-quit that broke because of USTATUS_SHUTDOWN. :-( ) --- irc_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'irc_commands.c') diff --git a/irc_commands.c b/irc_commands.c index dc59f7ee..519070db 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -31,7 +31,7 @@ static void irc_cmd_pass( irc_t *irc, char **cmd ) { if( global.conf->auth_pass && strcmp( cmd[1], global.conf->auth_pass ) == 0 ) { - irc->status = USTATUS_AUTHORIZED; + irc->status |= USTATUS_AUTHORIZED; irc_check_login( irc ); } else @@ -609,11 +609,11 @@ void irc_exec( irc_t *irc, char *cmd[] ) /* There should be no typo in the next line: */ for( n_arg = 0; cmd[n_arg]; n_arg ++ ); n_arg --; - if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status >= USTATUS_LOGGED_IN ) + if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status & USTATUS_LOGGED_IN ) { irc_reply( irc, 462, ":Only allowed before logging in" ); } - else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && irc->status < USTATUS_LOGGED_IN ) + else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && ! irc->status & USTATUS_LOGGED_IN ) { irc_reply( irc, 451, ":Register first" ); } -- cgit v1.2.3 From 3af70b06b2f0fb0fb41a041f6d86e3711b9eea3f Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 15 Jun 2006 14:37:05 +0200 Subject: !x&y == (!x)&y, not !(x&y). --- irc_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'irc_commands.c') diff --git a/irc_commands.c b/irc_commands.c index 519070db..f410bb52 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -613,7 +613,7 @@ void irc_exec( irc_t *irc, char *cmd[] ) { irc_reply( irc, 462, ":Only allowed before logging in" ); } - else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && ! irc->status & USTATUS_LOGGED_IN ) + else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && !( irc->status & USTATUS_LOGGED_IN ) ) { irc_reply( irc, 451, ":Register first" ); } -- cgit v1.2.3