Changeset 4e04194 for protocols/nogaim.c
- Timestamp:
- 2009-11-23T23:00:54Z (14 years ago)
- Branches:
- master
- Children:
- cd741d8
- Parents:
- b3117f2 (diff), fb51d85 (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
rb3117f2 r4e04194 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 ); … … 522 524 } 523 525 524 /* prpl.c */ 525 526 struct show_got_added_data 526 527 struct imcb_ask_cb_data 527 528 { 528 529 struct im_connection *ic; … … 530 531 }; 531 532 532 void show_got_added_no( void *data ) 533 { 534 g_free( ((struct show_got_added_data*)data)->handle ); 533 static void imcb_ask_auth_cb_no( void *data ) 534 { 535 struct imcb_ask_cb_data *cbd = data; 536 537 cbd->ic->acc->prpl->auth_deny( cbd->ic, cbd->handle ); 538 539 g_free( cbd->handle ); 540 g_free( cbd ); 541 } 542 543 static void imcb_ask_auth_cb_yes( void *data ) 544 { 545 struct imcb_ask_cb_data *cbd = data; 546 547 cbd->ic->acc->prpl->auth_allow( cbd->ic, cbd->handle ); 548 549 g_free( cbd->handle ); 550 g_free( cbd ); 551 } 552 553 void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname ) 554 { 555 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 556 char *s, *realname_ = NULL; 557 558 if( realname != NULL ) 559 realname_ = g_strdup_printf( " (%s)", realname ); 560 561 s = g_strdup_printf( "The user %s%s wants to add you to his/her buddy list.", 562 handle, realname_ ?: "" ); 563 564 g_free( realname_ ); 565 566 data->ic = ic; 567 data->handle = g_strdup( handle ); 568 query_add( ic->irc, ic, s, imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, data ); 569 } 570 571 572 static void imcb_ask_add_cb_no( void *data ) 573 { 574 g_free( ((struct imcb_ask_cb_data*)data)->handle ); 535 575 g_free( data ); 536 576 } 537 577 538 void show_got_added_yes( void *data ) 539 { 540 struct show_got_added_data *sga = data; 541 542 sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL ); 543 /* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */ 544 545 return show_got_added_no( data ); 546 } 547 548 void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ) 549 { 550 struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 ); 578 static void imcb_ask_add_cb_yes( void *data ) 579 { 580 struct imcb_ask_cb_data *cbd = data; 581 582 cbd->ic->acc->prpl->add_buddy( cbd->ic, cbd->handle, NULL ); 583 584 return imcb_ask_add_cb_no( data ); 585 } 586 587 void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname ) 588 { 589 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 551 590 char *s; 552 591 … … 559 598 data->ic = ic; 560 599 data->handle = g_strdup( handle ); 561 query_add( ic->irc, ic, s, show_got_added_yes, show_got_added_no, data );600 query_add( ic->irc, ic, s, imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data ); 562 601 } 563 602
Note: See TracChangeset
for help on using the changeset viewer.