changeset 22643:2e16a86883c7

Patch from fmoo to make double-clicking or hitting enter on a chatroom user open an IM with them. It's equivalent to right-clicking them and picking IM, so should work no worse than that does in the case where you don't actually know an XMPP MUC participant's real JID. Fixes #1935
author Will Thompson <will.thompson@collabora.co.uk>
date Fri, 11 Apr 2008 22:53:34 +0000
parents 5c8d236b50ee
children a1202a1aa150
files pidgin/gtkconv.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Fri Apr 11 22:31:55 2008 +0000
+++ b/pidgin/gtkconv.c	Fri Apr 11 22:53:34 2008 +0000
@@ -1813,6 +1813,22 @@
 }
 
 static void
+activate_list_cb(GtkTreeView *list, GtkTreePath *path, GtkTreeViewColumn *column, PidginConversation *gtkconv)
+{
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+	gchar *who;
+	
+	model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
+
+	gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path);
+	gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
+	chat_do_im(gtkconv, who);
+
+	g_free(who);
+}
+
+static void
 move_to_next_unread_tab(PidginConversation *gtkconv, gboolean forward)
 {
 	PidginConversation *next_gtkconv = NULL, *most_active = NULL;
@@ -4525,6 +4541,8 @@
 
 	g_signal_connect(G_OBJECT(list), "button_press_event",
 					 G_CALLBACK(right_click_chat_cb), gtkconv);
+	g_signal_connect(G_OBJECT(list), "row-activated",
+					 G_CALLBACK(activate_list_cb), gtkconv);
 	g_signal_connect(G_OBJECT(list), "popup-menu",
 			 G_CALLBACK(gtkconv_chat_popup_menu_cb), gtkconv);
 	g_signal_connect(G_OBJECT(lbox), "size-allocate", G_CALLBACK(lbox_size_allocate_cb), gtkconv);