Changeset fa295e36 for protocols/nogaim.c
- Timestamp:
- 2009-10-10T13:39:51Z (14 years ago)
- Branches:
- master
- Children:
- ba16895
- Parents:
- e59b4f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
re59b4f6 rfa295e36 506 506 } 507 507 508 /* prpl.c */ 509 510 struct show_got_added_data 508 509 struct imcb_ask_cb_data 511 510 { 512 511 struct im_connection *ic; … … 514 513 }; 515 514 516 void show_got_added_no( void *data ) 517 { 518 g_free( ((struct show_got_added_data*)data)->handle ); 515 static void imcb_ask_auth_cb_no( void *data ) 516 { 517 struct imcb_ask_cb_data *cbd = data; 518 519 cbd->ic->acc->prpl->auth_deny( cbd->ic, cbd->handle ); 520 521 g_free( cbd->handle ); 522 g_free( cbd ); 523 } 524 525 static void imcb_ask_auth_cb_yes( void *data ) 526 { 527 struct imcb_ask_cb_data *cbd = data; 528 529 cbd->ic->acc->prpl->auth_allow( cbd->ic, cbd->handle ); 530 531 g_free( cbd->handle ); 532 g_free( cbd ); 533 } 534 535 void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname ) 536 { 537 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 538 char *s, *realname_ = NULL; 539 540 if( realname != NULL ) 541 realname_ = g_strdup_printf( " (%s)", realname ); 542 543 s = g_strdup_printf( "The user %s%s wants to add you to his/her buddy list.", 544 handle, realname_ ?: "" ); 545 546 g_free( realname_ ); 547 548 data->ic = ic; 549 data->handle = g_strdup( handle ); 550 query_add( ic->irc, ic, s, imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, data ); 551 } 552 553 554 static void imcb_ask_add_cb_no( void *data ) 555 { 556 g_free( ((struct imcb_ask_cb_data*)data)->handle ); 519 557 g_free( data ); 520 558 } 521 559 522 void show_got_added_yes( void *data ) 523 { 524 struct show_got_added_data *sga = data; 525 526 sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL ); 527 /* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */ 528 529 return show_got_added_no( data ); 530 } 531 532 void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ) 533 { 534 struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 ); 560 static void imcb_ask_add_cb_yes( void *data ) 561 { 562 struct imcb_ask_cb_data *cbd = data; 563 564 cbd->ic->acc->prpl->add_buddy( cbd->ic, cbd->handle, NULL ); 565 566 return imcb_ask_add_cb_no( data ); 567 } 568 569 void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname ) 570 { 571 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 535 572 char *s; 536 573 … … 543 580 data->ic = ic; 544 581 data->handle = g_strdup( handle ); 545 query_add( ic->irc, ic, s, show_got_added_yes, show_got_added_no, data );582 query_add( ic->irc, ic, s, imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data ); 546 583 } 547 584
Note: See TracChangeset
for help on using the changeset viewer.