diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-04-07 11:22:48 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-04-07 11:22:48 +0200 |
commit | 7bf0f5f0ba40eb120809743220e3f776455fda63 (patch) | |
tree | 976c9e201c6c2d1f08420257c7ba7318dfd968e3 | |
parent | 36fa9bd3e3b918b282421b38735b4d1c024d799a (diff) |
Filled in show_got_added().
-rw-r--r-- | protocols/nogaim.c | 33 | ||||
-rw-r--r-- | query.c | 4 |
2 files changed, 34 insertions, 3 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c index de7faba7..fb9c7986 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -565,9 +565,40 @@ void serv_buddy_rename( struct gaim_connection *gc, char *handle, char *realname /* prpl.c */ +struct show_got_added_data +{ + struct gaim_connection *gc; + char *handle; +}; + +void show_got_added_no( gpointer w, struct show_got_added_data *data ) +{ + g_free( data->handle ); + g_free( data ); +} + +void show_got_added_yes( gpointer w, struct show_got_added_data *data ) +{ + data->gc->prpl->add_buddy( data->gc, data->handle ); + add_buddy( data->gc, NULL, data->handle, data->handle ); + + return show_got_added_no( w, data ); +} + void show_got_added( struct gaim_connection *gc, char *handle, const char *realname ) { - return; + struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 ); + char *s; + + /* TODO: Make a setting for this! */ + if( user_findhandle( gc, handle ) != NULL ) + return; + + s = g_strdup_printf( "The user %s is not in your buddy list yet. Do you want to add him/her now?", handle ); + + data->gc = gc; + data->handle = g_strdup( handle ); + query_add( gc->irc, gc, s, show_got_added_yes, show_got_added_no, data ); } @@ -139,13 +139,13 @@ void query_answer( irc_t *irc, query_t *q, int ans ) } if( ans ) { - q->yes( NULL, q->data ); serv_got_crap( q->gc, "Accepted: %s", q->question ); + q->yes( NULL, q->data ); } else { - q->no( NULL, q->data ); serv_got_crap( q->gc, "Rejected: %s", q->question ); + q->no( NULL, q->data ); } q->data = NULL; |