# HG changeset patch # User andrew.victor@mxit.com # Date 1303155533 0 # Node ID 6b59dd656feedee5053b54fd52556624e030046d # Parent 7119b2c43637b571f4b6f04c8728fa5bdff67e05 Improve searching. diff -r 7119b2c43637 -r 6b59dd656fee libpurple/protocols/mxit/profile.c --- a/libpurple/protocols/mxit/profile.c Mon Apr 18 19:38:21 2011 +0000 +++ b/libpurple/protocols/mxit/profile.c Mon Apr 18 19:38:53 2011 +0000 @@ -239,6 +239,21 @@ purple_notify_user_info_destroy( info ); } + +/*------------------------------------------------------------------------ + * Display the profiles of search results. + * + * @param gc The connection object + * @param row The selected row from search-results + * @param user_data NULL (unused) + */ +static void mxit_search_results_add_cb( PurpleConnection *gc, GList *row, gpointer user_data ) +{ + /* display add buddy dialog */ + purple_blist_request_add_buddy( purple_connection_get_account( gc ), g_list_nth_data( row, 0 ), NULL, g_list_nth_data( row, 1 ) ); +} + + /*------------------------------------------------------------------------ * Display the profiles of search results. * @@ -289,9 +304,13 @@ entries = g_list_next( entries ); } - // TODO: add buttons + /* button */ + purple_notify_searchresults_button_add( results, PURPLE_NOTIFY_BUTTON_INVITE, mxit_search_results_add_cb ); - text = g_strdup_printf( _( "We found %i contacts that match your search." ), maxResults ); + if ( searchType == CP_SUGGEST_FRIENDS ) + text = g_strdup_printf( _( "You have %i suggested friends." ), maxResults ); + else + text = g_strdup_printf( _( "We found %i contacts that match your search." ), maxResults ); purple_notify_searchresults( session->con, NULL, text, NULL, results, NULL, NULL );