Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision e59b4f65183a7bee638312a0c96e3d0607cb181f)
+++ protocols/nogaim.c	(revision fa295e3620bdf928b6a853ec7e42b8c7fc5262be)
@@ -506,7 +506,6 @@
 }
 
-/* prpl.c */
-
-struct show_got_added_data
+
+struct imcb_ask_cb_data
 {
 	struct im_connection *ic;
@@ -514,23 +513,61 @@
 };
 
-void show_got_added_no( void *data )
-{
-	g_free( ((struct show_got_added_data*)data)->handle );
+static void imcb_ask_auth_cb_no( void *data )
+{
+	struct imcb_ask_cb_data *cbd = data;
+	
+	cbd->ic->acc->prpl->auth_deny( cbd->ic, cbd->handle );
+	
+	g_free( cbd->handle );
+	g_free( cbd );
+}
+
+static void imcb_ask_auth_cb_yes( void *data )
+{
+	struct imcb_ask_cb_data *cbd = data;
+	
+	cbd->ic->acc->prpl->auth_allow( cbd->ic, cbd->handle );
+	
+	g_free( cbd->handle );
+	g_free( cbd );
+}
+
+void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname )
+{
+	struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 );
+	char *s, *realname_ = NULL;
+	
+	if( realname != NULL )
+		realname_ = g_strdup_printf( " (%s)", realname );
+	
+	s = g_strdup_printf( "The user %s%s wants to add you to his/her buddy list.",
+	                     handle, realname_ ?: "" );
+	
+	g_free( realname_ );
+	
+	data->ic = ic;
+	data->handle = g_strdup( handle );
+	query_add( ic->irc, ic, s, imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, data );
+}
+
+
+static void imcb_ask_add_cb_no( void *data )
+{
+	g_free( ((struct imcb_ask_cb_data*)data)->handle );
 	g_free( data );
 }
 
-void show_got_added_yes( void *data )
-{
-	struct show_got_added_data *sga = data;
-	
-	sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL );
-	/* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */
-	
-	return show_got_added_no( data );
-}
-
-void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname )
-{
-	struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 );
+static void imcb_ask_add_cb_yes( void *data )
+{
+	struct imcb_ask_cb_data *cbd = data;
+	
+	cbd->ic->acc->prpl->add_buddy( cbd->ic, cbd->handle, NULL );
+	
+	return imcb_ask_add_cb_no( data );
+}
+
+void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname )
+{
+	struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 );
 	char *s;
 	
@@ -543,5 +580,5 @@
 	data->ic = ic;
 	data->handle = g_strdup( handle );
-	query_add( ic->irc, ic, s, show_got_added_yes, show_got_added_no, data );
+	query_add( ic->irc, ic, s, imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data );
 }
 
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision e59b4f65183a7bee638312a0c96e3d0607cb181f)
+++ protocols/nogaim.h	(revision fa295e3620bdf928b6a853ec7e42b8c7fc5262be)
@@ -224,4 +224,8 @@
 	 * - Most protocols will just want to set this to g_strcasecmp().*/
 	int (* handle_cmp) (const char *who1, const char *who2);
+
+	/* Implement these callbacks if you want to use imcb_ask_auth() */
+	void (* auth_allow)	(struct im_connection *, const char *who);
+	void (* auth_deny)	(struct im_connection *, const char *who);
 };
 
@@ -252,4 +256,5 @@
 /* To tell the user an error, ie. before logging out when an error occurs. */
 G_MODULE_EXPORT void imcb_error( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
+
 /* To ask a your about something.
  * - 'msg' is the question.
@@ -258,5 +263,11 @@
  */
 G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont );
-G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
+
+/* Two common questions you may want to ask:
+ * - X added you to his contact list, allow?
+ * - X is not in your contact list, want to add?
+ */
+G_MODULE_EXPORT void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname );
+G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname );
 
 /* Buddy management */
Index: user.c
===================================================================
--- user.c	(revision e59b4f65183a7bee638312a0c96e3d0607cb181f)
+++ user.c	(revision fa295e3620bdf928b6a853ec7e42b8c7fc5262be)
@@ -141,5 +141,5 @@
 }
 
-user_t *user_findhandle( struct im_connection *ic, char *handle )
+user_t *user_findhandle( struct im_connection *ic, const char *handle )
 {
 	user_t *u;
Index: user.h
===================================================================
--- user.h	(revision e59b4f65183a7bee638312a0c96e3d0607cb181f)
+++ user.h	(revision fa295e3620bdf928b6a853ec7e42b8c7fc5262be)
@@ -56,5 +56,5 @@
 int user_del( irc_t *irc, char *nick );
 G_MODULE_EXPORT user_t *user_find( irc_t *irc, char *nick );
-G_MODULE_EXPORT user_t *user_findhandle( struct im_connection *ic, char *handle );
+G_MODULE_EXPORT user_t *user_findhandle( struct im_connection *ic, const char *handle );
 void user_rename( irc_t *irc, char *oldnick, char *newnick );
 
