Changeset 2288705 for protocols/nogaim.c
- Timestamp:
- 2009-12-07T21:54:19Z (15 years ago)
- Branches:
- master
- Children:
- 1c3008a
- Parents:
- aac4017 (diff), 36cf9fd (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
raac4017 r2288705 33 33 34 34 #define BITLBEE_CORE 35 #include <ctype.h> 36 35 37 #include "nogaim.h" 36 #include <ctype.h>38 #include "chat.h" 37 39 38 40 static int remove_chat_buddy_silent( struct groupchat *b, const char *handle ); … … 249 251 void imcb_connected( struct im_connection *ic ) 250 252 { 253 irc_t *irc = ic->irc; 254 struct chat *c; 251 255 user_t *u; 252 256 … … 271 275 exponential backoff timer. */ 272 276 ic->acc->auto_reconnect_delay = 0; 277 278 for( c = irc->chatrooms; c; c = c->next ) 279 { 280 if( c->acc != ic->acc ) 281 continue; 282 283 if( set_getbool( &c->set, "auto_join" ) ) 284 chat_join( irc, c, NULL ); 285 } 273 286 } 274 287 … … 309 322 ic->acc->prpl->logout( ic ); 310 323 b_event_remove( ic->inpa ); 324 325 g_free( ic->away ); 326 ic->away = NULL; 311 327 312 328 u = irc->users; … … 492 508 } 493 509 494 /* prpl.c */ 495 496 struct show_got_added_data 510 511 struct imcb_ask_cb_data 497 512 { 498 513 struct im_connection *ic; … … 500 515 }; 501 516 502 void show_got_added_no( void *data ) 503 { 504 g_free( ((struct show_got_added_data*)data)->handle ); 517 static void imcb_ask_auth_cb_no( void *data ) 518 { 519 struct imcb_ask_cb_data *cbd = data; 520 521 cbd->ic->acc->prpl->auth_deny( cbd->ic, cbd->handle ); 522 523 g_free( cbd->handle ); 524 g_free( cbd ); 525 } 526 527 static void imcb_ask_auth_cb_yes( void *data ) 528 { 529 struct imcb_ask_cb_data *cbd = data; 530 531 cbd->ic->acc->prpl->auth_allow( cbd->ic, cbd->handle ); 532 533 g_free( cbd->handle ); 534 g_free( cbd ); 535 } 536 537 void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname ) 538 { 539 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 540 char *s, *realname_ = NULL; 541 542 if( realname != NULL ) 543 realname_ = g_strdup_printf( " (%s)", realname ); 544 545 s = g_strdup_printf( "The user %s%s wants to add you to his/her buddy list.", 546 handle, realname_ ?: "" ); 547 548 g_free( realname_ ); 549 550 data->ic = ic; 551 data->handle = g_strdup( handle ); 552 query_add( ic->irc, ic, s, imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, data ); 553 } 554 555 556 static void imcb_ask_add_cb_no( void *data ) 557 { 558 g_free( ((struct imcb_ask_cb_data*)data)->handle ); 505 559 g_free( data ); 506 560 } 507 561 508 void show_got_added_yes( void *data ) 509 { 510 struct show_got_added_data *sga = data; 511 512 sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL ); 513 /* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */ 514 515 return show_got_added_no( data ); 516 } 517 518 void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ) 519 { 520 struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 ); 562 static void imcb_ask_add_cb_yes( void *data ) 563 { 564 struct imcb_ask_cb_data *cbd = data; 565 566 cbd->ic->acc->prpl->add_buddy( cbd->ic, cbd->handle, NULL ); 567 568 return imcb_ask_add_cb_no( data ); 569 } 570 571 void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname ) 572 { 573 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 521 574 char *s; 522 575 … … 529 582 data->ic = ic; 530 583 data->handle = g_strdup( handle ); 531 query_add( ic->irc, ic, s, show_got_added_yes, show_got_added_no, data );584 query_add( ic->irc, ic, s, imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data ); 532 585 } 533 586 … … 699 752 } 700 753 701 struct groupchat *imcb_chat_new( struct im_connection *ic, c har *handle )754 struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ) 702 755 { 703 756 struct groupchat *c; … … 928 981 int st; 929 982 930 if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) ) 931 st = 1; 932 else if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) ) 933 st = 0; 934 else if( sscanf( value, "%d", &st ) != 1 ) 935 return( NULL ); 936 937 st = st != 0; 983 if( !is_bool( value ) ) 984 return SET_INVALID; 985 986 st = bool2int( value ); 938 987 939 988 /* Horror.... */ … … 979 1028 } 980 1029 981 return ( set_eval_bool( set, value ) );1030 return value; 982 1031 } 983 1032
Note: See TracChangeset
for help on using the changeset viewer.