Index: bitlbee.c
===================================================================
--- bitlbee.c	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ bitlbee.c	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -236,5 +236,5 @@
 		irc->w_watch_source_id = 0;
 		
-		if( irc->status == USTATUS_SHUTDOWN )
+		if( irc->status & USTATUS_SHUTDOWN )
 			irc_free( irc );
 		
Index: ipc.c
===================================================================
--- ipc.c	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ ipc.c	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -115,5 +115,5 @@
 static void ipc_child_cmd_wallops( irc_t *irc, char **cmd )
 {
-	if( irc->status < USTATUS_LOGGED_IN )
+	if( ! irc->status & USTATUS_LOGGED_IN )
 		return;
 	
@@ -124,5 +124,5 @@
 static void ipc_child_cmd_lilo( irc_t *irc, char **cmd )
 {
-	if( irc->status < USTATUS_LOGGED_IN )
+	if( ! irc->status & USTATUS_LOGGED_IN )
 		return;
 	
@@ -133,5 +133,5 @@
 static void ipc_child_cmd_opermsg( irc_t *irc, char **cmd )
 {
-	if( irc->status < USTATUS_LOGGED_IN )
+	if( ! irc->status & USTATUS_LOGGED_IN )
 		return;
 	
@@ -154,5 +154,5 @@
 static void ipc_child_cmd_kill( irc_t *irc, char **cmd )
 {
-	if( irc->status < USTATUS_LOGGED_IN )
+	if( ! irc->status & USTATUS_LOGGED_IN )
 		return;
 	
@@ -166,5 +166,5 @@
 static void ipc_child_cmd_hello( irc_t *irc, char **cmd )
 {
-	if( irc->status < USTATUS_LOGGED_IN )
+	if( ! irc->status & USTATUS_LOGGED_IN )
 		ipc_to_master_str( "HELLO\r\n" );
 	else
Index: irc.c
===================================================================
--- irc.c	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ irc.c	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -179,5 +179,5 @@
 	}
 	
-	irc->status = USTATUS_SHUTDOWN;
+	irc->status |= USTATUS_SHUTDOWN;
 	if( irc->sendbuffer && !immed )
 	{
@@ -213,5 +213,5 @@
 	log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd );
 	
-	if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) ) 
+	if( irc->status & USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) ) 
 		if( storage_save( irc, TRUE ) != STORAGE_OK )
 			irc_usermsg( irc, "Error while saving settings!" );
@@ -701,5 +701,5 @@
 	if( irc->user && irc->nick )
 	{
-		if( global.conf->authmode == AUTHMODE_CLOSED && irc->status < USTATUS_AUTHORIZED )
+		if( global.conf->authmode == AUTHMODE_CLOSED && ! irc->status & USTATUS_AUTHORIZED )
 		{
 			irc_reply( irc, 464, ":This server is password-protected." );
@@ -758,5 +758,5 @@
 		ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname );
 	
-	irc->status = USTATUS_LOGGED_IN;
+	irc->status |= USTATUS_LOGGED_IN;
 }
 
@@ -1181,5 +1181,5 @@
 	int rv = 0;
 	
-	if( irc->status < USTATUS_LOGGED_IN )
+	if( ! irc->status & USTATUS_LOGGED_IN )
 	{
 		if( gettime() > ( irc->last_pong + IRC_LOGIN_TIMEOUT ) )
Index: irc.h
===================================================================
--- irc.h	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ irc.h	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -42,8 +42,8 @@
 {
 	USTATUS_OFFLINE = 0,
-	USTATUS_AUTHORIZED,
-	USTATUS_LOGGED_IN,
-	USTATUS_IDENTIFIED,
-	USTATUS_SHUTDOWN = -1
+	USTATUS_AUTHORIZED = 1,
+	USTATUS_LOGGED_IN = 2,
+	USTATUS_IDENTIFIED = 4,
+	USTATUS_SHUTDOWN = 8
 } irc_status_t;
 
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ irc_commands.c	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -32,5 +32,5 @@
 	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 );
 	}
@@ -610,9 +610,9 @@
 			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" );
Index: root_commands.c
===================================================================
--- root_commands.c	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ root_commands.c	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -163,5 +163,5 @@
 			
 		case STORAGE_OK:
-			irc->status = USTATUS_IDENTIFIED;
+			irc->status |= USTATUS_IDENTIFIED;
 			irc_umode_set( irc, "+R", 1 );
 			break;
@@ -187,5 +187,5 @@
 	case STORAGE_OK:
 		irc_setpass( irc, NULL );
-		irc->status = USTATUS_LOGGED_IN;
+		irc->status &= ~USTATUS_IDENTIFIED;
 		irc_umode_set( irc, "-R", 1 );
 		irc_usermsg( irc, "Account `%s' removed", irc->nick );
@@ -201,5 +201,5 @@
 	account_t *a;
 	
-	if( global.conf->authmode == AUTHMODE_REGISTERED && irc->status < USTATUS_IDENTIFIED )
+	if( global.conf->authmode == AUTHMODE_REGISTERED && ! irc->status & USTATUS_IDENTIFIED )
 	{
 		irc_usermsg( irc, "This server only accepts registered users" );
Index: storage_text.c
===================================================================
--- storage_text.c	(revision 5a5c926ec0dffa4b28895929c092089c2a9b9d9f)
+++ storage_text.c	(revision 79e826a028f4b4c62c0c16e20af1fb13a9636324)
@@ -71,5 +71,5 @@
 	user_t *ru = user_find( irc, ROOT_NICK );
 	
-	if( irc->status >= USTATUS_IDENTIFIED )
+	if( irc->status & USTATUS_IDENTIFIED )
 		return( 1 );
 	
@@ -88,5 +88,5 @@
 	/* Do this now. If the user runs with AuthMode = Registered, the
 	   account command will not work otherwise. */
-	irc->status = USTATUS_IDENTIFIED;
+	irc->status |= USTATUS_IDENTIFIED;
 	
 	while( fscanf( fp, "%511[^\n]s", s ) > 0 )
