[ebaebfe] | 1 | #include "bitlbee.h" |
---|
| 2 | |
---|
| 3 | bee_t *bee_new() |
---|
| 4 | { |
---|
| 5 | bee_t *b = g_new0( bee_t, 1 ); |
---|
| 6 | set_t *s; |
---|
| 7 | |
---|
| 8 | s = set_add( &b->set, "away", NULL, NULL/*set_eval_away_status*/, b ); |
---|
| 9 | s->flags |= SET_NULL_OK; |
---|
| 10 | s = set_add( &b->set, "auto_connect", "true", set_eval_bool, b ); |
---|
| 11 | s = set_add( &b->set, "auto_reconnect", "true", set_eval_bool, b ); |
---|
| 12 | s = set_add( &b->set, "auto_reconnect_delay", "5*3<900", NULL/*set_eval_account_reconnect_delay*/, b ); |
---|
| 13 | s = set_add( &b->set, "debug", "false", set_eval_bool, b ); |
---|
| 14 | s = set_add( &b->set, "password", NULL, NULL/*set_eval_password*/, b ); |
---|
| 15 | s->flags |= SET_NULL_OK; |
---|
| 16 | s = set_add( &b->set, "save_on_quit", "true", set_eval_bool, b ); |
---|
| 17 | s = set_add( &b->set, "status", NULL, NULL/*set_eval_away_status*/, b ); |
---|
| 18 | s->flags |= SET_NULL_OK; |
---|
| 19 | s = set_add( &b->set, "strip_html", "true", NULL, b ); |
---|
| 20 | |
---|
| 21 | return b; |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | void bee_free( bee_t *b ) |
---|
| 25 | { |
---|
| 26 | while( b->accounts ) |
---|
| 27 | { |
---|
| 28 | account_t *acc = b->accounts->data; |
---|
| 29 | |
---|
| 30 | /* |
---|
| 31 | if( acc->ic ) |
---|
| 32 | imc_logout( acc->ic, FALSE ); |
---|
| 33 | else if( acc->reconnect ) |
---|
| 34 | cancel_auto_reconnect( acc ); |
---|
| 35 | */ |
---|
| 36 | |
---|
| 37 | if( acc->ic == NULL ) |
---|
| 38 | {} //account_del( b, acc ); |
---|
| 39 | else |
---|
| 40 | /* Nasty hack, but account_del() doesn't work in this |
---|
| 41 | case and we don't want infinite loops, do we? ;-) */ |
---|
| 42 | b->accounts = g_slist_remove( b->accounts, acc ); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | while( b->set ) |
---|
| 46 | set_del( &b->set, b->set->key ); |
---|
| 47 | } |
---|