Changes in protocols/account.c [bb5ce568:0e788f5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/account.c
rbb5ce568 r0e788f5 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-201 0Wilmer van der Gaast and others *4 * Copyright 2002-2013 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 53 53 54 54 s = set_add( &a->set, "auto_connect", "true", set_eval_account, a ); 55 s->flags |= SET_NOSAVE;55 s->flags |= ACC_SET_NOSAVE; 56 56 57 57 s = set_add( &a->set, "auto_reconnect", "true", set_eval_bool, a ); … … 61 61 62 62 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! */ 64 64 65 65 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; 67 67 68 68 s = set_add( &a->set, "tag", NULL, set_eval_account, a ); 69 s->flags |= SET_NOSAVE;69 s->flags |= ACC_SET_NOSAVE; 70 70 71 71 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; 73 73 set_setstr( &a->set, "username", user ); 74 74 … … 154 154 else if( strcmp( set->key, "password" ) == 0 ) 155 155 { 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! */ 168 164 } 169 165 else if( strcmp( set->key, "tag" ) == 0 ) … … 354 350 a->prpl->login( a ); 355 351 356 if( a->ic && !( a->ic->flags & OPT_SLOW_LOGIN) )352 if( a->ic && !( a->ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) ) 357 353 a->ic->keepalive = b_timeout_add( 120000, account_on_timeout, a->ic ); 358 354 } … … 373 369 struct im_connection *ic = d; 374 370 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 } 377 376 378 377 return FALSE;
Note: See TracChangeset
for help on using the changeset viewer.