changeset 13641:87d41308a0eb

[gaim-migrate @ 16039] Fixes #1448164 (Add IM button to the search results window). committer: Tailor Script <tailor@pidgin.im>
author Bartoz Oler <bartosz@pidgin.im>
date Sun, 16 Apr 2006 10:49:35 +0000
parents d12bbe6da705
children c99d04f8a42b
files src/protocols/gg/gg.c
diffstat 1 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/gg/gg.c	Sun Apr 16 10:10:55 2006 +0000
+++ b/src/protocols/gg/gg.c	Sun Apr 16 10:49:35 2006 +0000
@@ -504,8 +504,8 @@
 
 /*
  */
-/* static void ggp_callback_show_next(GaimConnection *gc, GList *row, void *user_data) {{{ */
-static void ggp_callback_show_next(GaimConnection *gc, GList *row, void *user_data)
+/* static void ggp_callback_show_next(GaimConnection *gc, GList *row, gpointer user_data) {{{ */
+static void ggp_callback_show_next(GaimConnection *gc, GList *row, gpointer user_data)
 {
 	GGPInfo *info = gc->proto_data;
 	GGPSearchForm *form = user_data;
@@ -523,8 +523,8 @@
 
 /*
  */
-/* static void ggp_callback_add_buddy(GaimConnection *gc, GList *row, void *user_data) {{{ */
-static void ggp_callback_add_buddy(GaimConnection *gc, GList *row, void *user_data)
+/* static void ggp_callback_add_buddy(GaimConnection *gc, GList *row, gpointer user_data) {{{ */
+static void ggp_callback_add_buddy(GaimConnection *gc, GList *row, gpointer user_data)
 {
 	gaim_blist_request_add_buddy(gaim_connection_get_account(gc),
 				     g_list_nth_data(row, 0), NULL, NULL);
@@ -533,6 +533,23 @@
 
 /*
  */
+/* static void ggp_callback_im(GaimConnection *gc, GList *row, gpointer user_data) {{{ */
+static void ggp_callback_im(GaimConnection *gc, GList *row, gpointer user_data)
+{
+	GaimAccount *account;
+	GaimConversation *conv;
+	char *name;
+
+	account = gaim_connection_get_account(gc);
+
+	name = g_list_nth_data(row, 0);
+	conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, name);
+	gaim_conversation_present(conv);
+}
+/* }}} */
+
+/*
+ */
 /* static void ggp_callback_find_buddies(GaimConnection *gc, GaimRequestFields *fields) {{{ */
 static void ggp_callback_find_buddies(GaimConnection *gc, GaimRequestFields *fields)
 {
@@ -1055,6 +1072,8 @@
 					     ggp_callback_show_next);
 	gaim_notify_searchresults_button_add(results, GAIM_NOTIFY_BUTTON_ADD,
 					     ggp_callback_add_buddy);
+	gaim_notify_searchresults_button_add(results, GAIM_NOTIFY_BUTTON_IM,
+					     ggp_callback_im);
 	if (form->window == NULL) {
 		void *h = gaim_notify_searchresults(gc,
 				_("Gadu-Gadu Public Directory"),