diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-04-08 16:10:29 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-04-08 16:10:29 +0200 |
commit | 11bcee97b781bac6e38db4e1630ac6934209e73b (patch) | |
tree | d1377a6ebef982752ce3e9afd3137b370d87d1c1 /protocols/nogaim.c | |
parent | f8de26f98e3c38d3deacb674e533c588e6b48548 (diff) | |
parent | 9e08d5d5ba8958807158d7afaedd40e60cfb40ff (diff) |
Misc. merges. (Main thing: "$blah is not in your list yet, would you like to add him?")
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r-- | protocols/nogaim.c | 33 |
1 files changed, 32 insertions, 1 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 ); } |