Index: libempathy-gtk/empathy-contact-list-view.c
===================================================================
--- libempathy-gtk/empathy-contact-list-view.c	(revisione 461)
+++ libempathy-gtk/empathy-contact-list-view.c	(copia locale)
@@ -1379,6 +1379,97 @@ contact_list_view_row_expand_or_collapse
 	g_free (name);
 }
 
+typedef struct
+{
+	EmpathyContactListView *view;
+	GtkWidget *entry, *dialog;
+	gchar *group;
+} RenameDialogCBStruct;
+
+static void
+rename_dialog_response_cb (GtkDialog *dialog,
+			   gint response_id,
+			   RenameDialogCBStruct *data)
+{
+	if (response_id == GTK_RESPONSE_OK)
+	{
+		EmpathyContactListView *view = data->view;
+		EmpathyContactListViewPriv *priv;
+		GtkWidget *entry = data->entry;
+		EmpathyContactList *list;
+		const gchar *new_group, *old_group = data->group;
+		
+		priv = GET_PRIV (view);
+		new_group = gtk_entry_get_text (GTK_ENTRY (entry));
+		list = empathy_contact_list_store_get_list_iface (priv->store);
+		
+		empathy_contact_list_rename_group (list, old_group, new_group);
+	}
+	
+	g_free (data->group);
+	g_slice_free (RenameDialogCBStruct, data);
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+rename_dialog_entry_activated_cb (GtkEntry *entry,
+				  RenameDialogCBStruct *data)
+{
+	rename_dialog_response_cb (GTK_DIALOG (data->dialog),
+				   GTK_RESPONSE_OK,
+				   data);
+}
+
+static void
+contact_list_view_rename_group (EmpathyContactListView *view,
+				gchar *group)
+{
+	GtkWidget *dialog, *vbox, *label, *entry;
+	GtkWindow *parent;
+	RenameDialogCBStruct *cb_data;
+	
+	parent = empathy_get_toplevel_window (GTK_WIDGET (view));
+
+	dialog = gtk_dialog_new_with_buttons (NULL,
+					      parent,
+					      GTK_DIALOG_DESTROY_WITH_PARENT,
+					      GTK_STOCK_CANCEL,
+					      GTK_RESPONSE_CANCEL,
+					      _("Rename group"),
+					      GTK_RESPONSE_OK,
+					      NULL);
+	gtk_dialog_set_has_separator (GTK_DIALOG (dialog),
+				      FALSE);
+	gtk_widget_show (dialog);
+
+	vbox = gtk_vbox_new (FALSE, 4);
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
+	gtk_widget_show (vbox);
+
+	label = gtk_label_new (_("Enter the new name for the group:"));
+	gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+	gtk_widget_show (label);
+	entry = gtk_entry_new ();
+	gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
+	gtk_widget_show (entry);
+	
+	gtk_entry_set_text (GTK_ENTRY (entry), group);
+	
+	gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
+			   vbox);
+
+	cb_data = g_slice_new0 (RenameDialogCBStruct);
+	cb_data->group = g_strdup (group);
+	cb_data->entry = entry;
+	cb_data->dialog = dialog;
+	cb_data->view = view;
+	
+	g_signal_connect (dialog, "response",
+			  G_CALLBACK (rename_dialog_response_cb), cb_data);
+	g_signal_connect (entry, "activate",
+			  G_CALLBACK (rename_dialog_entry_activated_cb), cb_data);
+}
+
 static void
 contact_list_view_action_cb (GtkAction             *action,
 			     EmpathyContactListView *view)
@@ -1433,6 +1524,7 @@ contact_list_view_action_cb (GtkAction  
 					parent);
 	}
 	else if (group && strcmp (name, "Rename") == 0) {
+		contact_list_view_rename_group (view, group);
 	}
 
 	g_free (group);
