diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-15 14:22:17 +0200 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-15 14:22:17 +0200 | 
| commit | 79e826a028f4b4c62c0c16e20af1fb13a9636324 (patch) | |
| tree | 5ddc446344fd7659ae847efc00f7ff70a8e3764a /irc.c | |
| parent | 5a5c926ec0dffa4b28895929c092089c2a9b9d9f (diff) | |
Converted irc->status to binary flags. (This also fixes auto-save-on-quit
that broke because of USTATUS_SHUTDOWN. :-( )
Diffstat (limited to 'irc.c')
| -rw-r--r-- | irc.c | 10 | 
1 files changed, 5 insertions, 5 deletions
| @@ -178,7 +178,7 @@ void irc_abort( irc_t *irc, int immed, char *format, ... )  	        	           irc->nick ? irc->nick : "(NONE)", irc->host, "No reason given" );  	} -	irc->status = USTATUS_SHUTDOWN; +	irc->status |= USTATUS_SHUTDOWN;  	if( irc->sendbuffer && !immed )  	{  		/* We won't read from this socket anymore. Instead, we'll connect a timer @@ -212,7 +212,7 @@ void irc_free(irc_t * irc)  	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!" ); @@ -700,7 +700,7 @@ int irc_check_login( irc_t *irc )  {  	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." );  			return 0; @@ -757,7 +757,7 @@ void irc_login( irc_t *irc )  	if( global.conf->runmode == RUNMODE_FORKDAEMON || global.conf->runmode == RUNMODE_DAEMON )  		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;  }  void irc_motd( irc_t *irc ) @@ -1180,7 +1180,7 @@ static gboolean irc_userping( gpointer _irc )  	irc_t *irc = _irc;  	int rv = 0; -	if( irc->status < USTATUS_LOGGED_IN ) +	if( ! irc->status & USTATUS_LOGGED_IN )  	{  		if( gettime() > ( irc->last_pong + IRC_LOGIN_TIMEOUT ) )  			rv = gettime() - irc->last_pong; | 
