Changeset 280e655
- Timestamp:
- 2008-08-05T23:07:07Z (16 years ago)
- Branches:
- master
- Children:
- 4230221
- Parents:
- d84e2a9
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
account.c
rd84e2a9 r280e655 234 234 } 235 235 } 236 237 char *set_eval_account_reconnect_delay( set_t *set, char *value ) 238 { 239 int start; 240 char op; 241 int step; 242 243 if( sscanf( value, "%d%c%d", &start, &op, &step ) == 3 && 244 step > 0 && ( op == '+' || op == '*' ) ) 245 return value; 246 else 247 return set_eval_int( set, value ); 248 } 249 250 int account_reconnect_delay( account_t *a ) 251 { 252 char *setting = set_getstr( &a->irc->set, "auto_reconnect_delay" ); 253 int start, step; 254 char op; 255 256 if( sscanf( setting, "%d%c%d", &start, &op, &step ) == 3 && step > 0 ) 257 { 258 if( a->auto_reconnect_delay == 0 ) 259 return a->auto_reconnect_delay = start; 260 else if( op == '+' ) 261 return a->auto_reconnect_delay += step; 262 else if( op == '*' ) 263 return a->auto_reconnect_delay *= step; 264 } 265 else if( sscanf( setting, "%d", &start ) == 1 ) 266 { 267 return a->auto_reconnect_delay = start; 268 } 269 270 return 0; 271 } -
account.h
rd84e2a9 r280e655 35 35 36 36 int auto_connect; 37 int auto_reconnect_delay; 37 38 int reconnect; 38 39 … … 52 53 53 54 char *set_eval_account( set_t *set, char *value ); 55 char *set_eval_account_reconnect_delay( set_t *set, char *value ); 56 int account_reconnect_delay( account_t *a ); 54 57 55 58 #define ACC_SET_NOSAVE 1 -
irc.c
rd84e2a9 r280e655 139 139 set_add( &irc->set, "auto_connect", "true", set_eval_bool, irc ); 140 140 set_add( &irc->set, "auto_reconnect", "false", set_eval_bool, irc ); 141 set_add( &irc->set, "auto_reconnect_delay", "300", set_eval_ int, irc );141 set_add( &irc->set, "auto_reconnect_delay", "300", set_eval_account_reconnect_delay, irc ); 142 142 set_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc ); 143 143 set_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc ); -
protocols/nogaim.c
rd84e2a9 r280e655 267 267 protocols. */ 268 268 imc_set_away( ic, u->away ); 269 270 /* Apparently we're connected successfully, so reset the 271 exponential backoff timer. */ 272 ic->acc->auto_reconnect_delay = 0; 269 273 } 270 274 … … 331 335 set_getbool( &a->set, "auto_reconnect" ) ) 332 336 { 333 int delay = set_getint( &irc->set, "auto_reconnect_delay");337 int delay = account_reconnect_delay( a ); 334 338 335 339 imcb_log( ic, "Reconnecting in %d seconds..", delay );
Note: See TracChangeset
for help on using the changeset viewer.