aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-04-07 11:22:48 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-04-07 11:22:48 +0200
commit7bf0f5f0ba40eb120809743220e3f776455fda63 (patch)
tree976c9e201c6c2d1f08420257c7ba7318dfd968e3 /protocols/nogaim.c
parent36fa9bd3e3b918b282421b38735b4d1c024d799a (diff)
Filled in show_got_added().
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c33
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 );
}