Changeset c5bc47b for protocols/nogaim.c
- Timestamp:
- 2009-10-17T17:24:52Z (15 years ago)
- Branches:
- master
- Children:
- c48a033
- Parents:
- 0c41177 (diff), 2e44b1f (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
r0c41177 rc5bc47b 249 249 void imcb_connected( struct im_connection *ic ) 250 250 { 251 irc_t *irc = ic->irc; 252 struct chat *c; 251 253 user_t *u; 252 254 … … 271 273 exponential backoff timer. */ 272 274 ic->acc->auto_reconnect_delay = 0; 275 276 for( c = irc->chatrooms; c; c = c->next ) 277 { 278 if( c->acc != ic->acc ) 279 continue; 280 281 if( set_getbool( &c->set, "auto_join" ) ) 282 chat_join( irc, c, NULL ); 283 } 273 284 } 274 285 … … 309 320 ic->acc->prpl->logout( ic ); 310 321 b_event_remove( ic->inpa ); 322 323 g_free( ic->away ); 324 ic->away = NULL; 311 325 312 326 u = irc->users; … … 492 506 } 493 507 494 /* prpl.c */ 495 496 struct show_got_added_data 508 509 struct imcb_ask_cb_data 497 510 { 498 511 struct im_connection *ic; … … 500 513 }; 501 514 502 void show_got_added_no( void *data ) 503 { 504 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 ); 505 557 g_free( data ); 506 558 } 507 559 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 ); 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 ); 521 572 char *s; 522 573 … … 529 580 data->ic = ic; 530 581 data->handle = g_strdup( handle ); 531 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 ); 532 583 } 533 584 … … 699 750 } 700 751 701 struct groupchat *imcb_chat_new( struct im_connection *ic, c har *handle )752 struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ) 702 753 { 703 754 struct groupchat *c;
Note: See TracChangeset
for help on using the changeset viewer.