Changeset 07e46c9


Ignore:
Timestamp:
2006-06-16T11:26:51Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
c2fa827
Parents:
b4e4b95 (diff), 3af70b0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

[merge] upstream

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    rb4e4b95 r07e46c9  
    236236                irc->w_watch_source_id = 0;
    237237               
    238                 if( irc->status == USTATUS_SHUTDOWN )
     238                if( irc->status & USTATUS_SHUTDOWN )
    239239                        irc_free( irc );
    240240               
  • ipc.c

    rb4e4b95 r07e46c9  
    115115static void ipc_child_cmd_wallops( irc_t *irc, char **cmd )
    116116{
    117         if( irc->status < USTATUS_LOGGED_IN )
     117        if( !( irc->status & USTATUS_LOGGED_IN ) )
    118118                return;
    119119       
     
    124124static void ipc_child_cmd_lilo( irc_t *irc, char **cmd )
    125125{
    126         if( irc->status < USTATUS_LOGGED_IN )
     126        if( !( irc->status & USTATUS_LOGGED_IN ) )
    127127                return;
    128128       
     
    133133static void ipc_child_cmd_opermsg( irc_t *irc, char **cmd )
    134134{
    135         if( irc->status < USTATUS_LOGGED_IN )
     135        if( !( irc->status & USTATUS_LOGGED_IN ) )
    136136                return;
    137137       
     
    154154static void ipc_child_cmd_kill( irc_t *irc, char **cmd )
    155155{
    156         if( irc->status < USTATUS_LOGGED_IN )
     156        if( !( irc->status & USTATUS_LOGGED_IN ) )
    157157                return;
    158158       
     
    166166static void ipc_child_cmd_hello( irc_t *irc, char **cmd )
    167167{
    168         if( irc->status < USTATUS_LOGGED_IN )
     168        if( !( irc->status & USTATUS_LOGGED_IN ) )
    169169                ipc_to_master_str( "HELLO\r\n" );
    170170        else
  • irc.c

    rb4e4b95 r07e46c9  
    179179        }
    180180       
    181         irc->status = USTATUS_SHUTDOWN;
     181        irc->status |= USTATUS_SHUTDOWN;
    182182        if( irc->sendbuffer && !immed )
    183183        {
     
    213213        log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd );
    214214       
    215         if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) )
     215        if( irc->status & USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) )
    216216                if( storage_save( irc, TRUE ) != STORAGE_OK )
    217217                        irc_usermsg( irc, "Error while saving settings!" );
     
    701701        if( irc->user && irc->nick )
    702702        {
    703                 if( global.conf->authmode == AUTHMODE_CLOSED && irc->status < USTATUS_AUTHORIZED )
     703                if( global.conf->authmode == AUTHMODE_CLOSED && !( irc->status & USTATUS_AUTHORIZED ) )
    704704                {
    705705                        irc_reply( irc, 464, ":This server is password-protected." );
     
    758758                ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname );
    759759       
    760         irc->status = USTATUS_LOGGED_IN;
     760        irc->status |= USTATUS_LOGGED_IN;
    761761}
    762762
     
    11811181        int rv = 0;
    11821182       
    1183         if( irc->status < USTATUS_LOGGED_IN )
     1183        if( !( irc->status & USTATUS_LOGGED_IN ) )
    11841184        {
    11851185                if( gettime() > ( irc->last_pong + IRC_LOGIN_TIMEOUT ) )
  • irc.h

    rb4e4b95 r07e46c9  
    4242{
    4343        USTATUS_OFFLINE = 0,
    44         USTATUS_AUTHORIZED,
    45         USTATUS_LOGGED_IN,
    46         USTATUS_IDENTIFIED,
    47         USTATUS_SHUTDOWN = -1
     44        USTATUS_AUTHORIZED = 1,
     45        USTATUS_LOGGED_IN = 2,
     46        USTATUS_IDENTIFIED = 4,
     47        USTATUS_SHUTDOWN = 8
    4848} irc_status_t;
    4949
  • irc_commands.c

    rb4e4b95 r07e46c9  
    3232        if( global.conf->auth_pass && strcmp( cmd[1], global.conf->auth_pass ) == 0 )
    3333        {
    34                 irc->status = USTATUS_AUTHORIZED;
     34                irc->status |= USTATUS_AUTHORIZED;
    3535                irc_check_login( irc );
    3636        }
     
    610610                        for( n_arg = 0; cmd[n_arg]; n_arg ++ ); n_arg --;
    611611                       
    612                         if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status >= USTATUS_LOGGED_IN )
     612                        if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status & USTATUS_LOGGED_IN )
    613613                        {
    614614                                irc_reply( irc, 462, ":Only allowed before logging in" );
    615615                        }
    616                         else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && irc->status < USTATUS_LOGGED_IN )
     616                        else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && !( irc->status & USTATUS_LOGGED_IN ) )
    617617                        {
    618618                                irc_reply( irc, 451, ":Register first" );
  • root_commands.c

    rb4e4b95 r07e46c9  
    163163                       
    164164                case STORAGE_OK:
    165                         irc->status = USTATUS_IDENTIFIED;
     165                        irc->status |= USTATUS_IDENTIFIED;
    166166                        irc_umode_set( irc, "+R", 1 );
    167167                        break;
     
    187187        case STORAGE_OK:
    188188                irc_setpass( irc, NULL );
    189                 irc->status = USTATUS_LOGGED_IN;
     189                irc->status &= ~USTATUS_IDENTIFIED;
    190190                irc_umode_set( irc, "-R", 1 );
    191191                irc_usermsg( irc, "Account `%s' removed", irc->nick );
     
    201201        account_t *a;
    202202       
    203         if( global.conf->authmode == AUTHMODE_REGISTERED && irc->status < USTATUS_IDENTIFIED )
     203        if( global.conf->authmode == AUTHMODE_REGISTERED && !( irc->status & USTATUS_IDENTIFIED ) )
    204204        {
    205205                irc_usermsg( irc, "This server only accepts registered users" );
  • storage_text.c

    rb4e4b95 r07e46c9  
    7171        user_t *ru = user_find( irc, ROOT_NICK );
    7272       
    73         if( irc->status >= USTATUS_IDENTIFIED )
     73        if( irc->status & USTATUS_IDENTIFIED )
    7474                return( 1 );
    7575       
     
    8888        /* Do this now. If the user runs with AuthMode = Registered, the
    8989           account command will not work otherwise. */
    90         irc->status = USTATUS_IDENTIFIED;
     90        irc->status |= USTATUS_IDENTIFIED;
    9191       
    9292        while( fscanf( fp, "%511[^\n]s", s ) > 0 )
Note: See TracChangeset for help on using the changeset viewer.