Changeset 3f81999 for protocols/nogaim.c


Ignore:
Timestamp:
2010-06-03T10:31:46Z (14 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
5f8ab6a9
Parents:
fc34fb5 (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.
Message:

merge in bitlbee 1.2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    rfc34fb5 r3f81999  
    506506}
    507507
    508 /* prpl.c */
    509 
    510 struct show_got_added_data
     508
     509struct imcb_ask_cb_data
    511510{
    512511        struct im_connection *ic;
     
    514513};
    515514
    516 void show_got_added_no( void *data )
    517 {
    518         g_free( ((struct show_got_added_data*)data)->handle );
     515static 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
     525static 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
     535void 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
     554static void imcb_ask_add_cb_no( void *data )
     555{
     556        g_free( ((struct imcb_ask_cb_data*)data)->handle );
    519557        g_free( data );
    520558}
    521559
    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 );
     560static 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
     569void 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 );
    535572        char *s;
    536573       
     
    543580        data->ic = ic;
    544581        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 );
    546583}
    547584
Note: See TracChangeset for help on using the changeset viewer.