pidgin.mxit: c4f92259: Improve searching.
andrew.victor at mxit.com
andrew.victor at mxit.com
Mon Apr 18 17:25:44 EDT 2011
----------------------------------------------------------------------
Revision: c4f92259c46aa8d657f99694e71e2376d4794b44
Parent: aa83945596eab8e928a8bddefda63705b3e2d647
Author: andrew.victor at mxit.com
Date: 04/18/11 15:38:53
Branch: im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/c4f92259c46aa8d657f99694e71e2376d4794b44
Changelog:
Improve searching.
Changes against parent aa83945596eab8e928a8bddefda63705b3e2d647
patched libpurple/protocols/mxit/profile.c
-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/profile.c ab846211fba6a1777912d2ddddd4b3862ff4aabf
+++ libpurple/protocols/mxit/profile.c 7ad49d47b8d747b627ec1e94003627233fd7e8bc
@@ -239,9 +239,24 @@ void mxit_show_profile( struct MXitSessi
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.
+ *
* @param session The MXit session object
* @param searchType The type of search (CP_SUGGEST_*)
* @param maxResults The maximum number of results
@@ -289,9 +304,13 @@ void mxit_show_search_results( struct MX
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 );
More information about the Commits
mailing list