Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/account.c

    rbb5ce568 r0e788f5  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2010 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2013 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    5353       
    5454        s = set_add( &a->set, "auto_connect", "true", set_eval_account, a );
    55         s->flags |= SET_NOSAVE;
     55        s->flags |= ACC_SET_NOSAVE;
    5656       
    5757        s = set_add( &a->set, "auto_reconnect", "true", set_eval_bool, a );
     
    6161       
    6262        s = set_add( &a->set, "nick_source", "handle", set_eval_nick_source, a );
    63         s->flags |= SET_NOSAVE; /* Just for bw compatibility! */
     63        s->flags |= ACC_SET_NOSAVE; /* Just for bw compatibility! */
    6464       
    6565        s = set_add( &a->set, "password", NULL, set_eval_account, a );
    66         s->flags |= SET_NOSAVE | SET_NULL_OK | SET_PASSWORD;
     66        s->flags |= ACC_SET_NOSAVE | SET_NULL_OK | SET_PASSWORD;
    6767       
    6868        s = set_add( &a->set, "tag", NULL, set_eval_account, a );
    69         s->flags |= SET_NOSAVE;
     69        s->flags |= ACC_SET_NOSAVE;
    7070       
    7171        s = set_add( &a->set, "username", NULL, set_eval_account, a );
    72         s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY;
     72        s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY;
    7373        set_setstr( &a->set, "username", user );
    7474       
     
    154154        else if( strcmp( set->key, "password" ) == 0 )
    155155        {
    156                 if( value )
    157                 {
    158                         g_free( acc->pass );
    159                         acc->pass = g_strdup( value );
    160                         return NULL;    /* password shouldn't be visible in plaintext! */
    161                 }
    162                 else
    163                 {
    164                         /* NULL can (should) be stored in the set_t
    165                            variable, but is otherwise not correct. */
    166                         return SET_INVALID;
    167                 }
     156                /* set -del should be allowed now, but I don't want to have any
     157                   NULL pointers to have to deal with. */
     158                if( !value )
     159                        value = "";
     160               
     161                g_free( acc->pass );
     162                acc->pass = g_strdup( value );
     163                return NULL;    /* password shouldn't be visible in plaintext! */
    168164        }
    169165        else if( strcmp( set->key, "tag" ) == 0 )
     
    354350        a->prpl->login( a );
    355351       
    356         if( a->ic && !( a->ic->flags & OPT_SLOW_LOGIN ) )
     352        if( a->ic && !( a->ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) )
    357353                a->ic->keepalive = b_timeout_add( 120000, account_on_timeout, a->ic );
    358354}
     
    373369        struct im_connection *ic = d;
    374370       
    375         imcb_error( ic, "Connection timeout" );
    376         imc_logout( ic, TRUE );
     371        if( !( ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) )
     372        {
     373                imcb_error( ic, "Connection timeout" );
     374                imc_logout( ic, TRUE );
     375        }
    377376       
    378377        return FALSE;
Note: See TracChangeset for help on using the changeset viewer.