empathy r2815 - branches/gnome-2-26/libempathy-gtk



Author: xclaesse
Date: Mon Apr 13 08:23:17 2009
New Revision: 2815
URL: http://svn.gnome.org/viewvc/empathy?rev=2815&view=rev

Log:
Let the chat dialog directly grab the channel on reconnect

When reconnecting open chat dialogs requests a new channel. It can grab this
directly when it is opened, no need to go through the dispatcher. Fixes issue
with stealing focus

From: Sjoerd Simons <sjoerd simons collabora co uk>

Modified:
   branches/gnome-2-26/libempathy-gtk/empathy-chat.c

Modified: branches/gnome-2-26/libempathy-gtk/empathy-chat.c
==============================================================================
--- branches/gnome-2-26/libempathy-gtk/empathy-chat.c	(original)
+++ branches/gnome-2-26/libempathy-gtk/empathy-chat.c	Mon Apr 13 08:23:17 2009
@@ -168,6 +168,26 @@
 }
 
 static void
+chat_connect_channel_reconnected (EmpathyDispatchOperation *dispatch,
+				  const GError             *error,
+				  gpointer                  user_data)
+{
+	EmpathyChat *chat = EMPATHY_CHAT (user_data);
+	EmpathyTpChat *tpchat;
+
+	if (error != NULL) {
+		return;
+	}
+
+	tpchat = EMPATHY_TP_CHAT (
+		empathy_dispatch_operation_get_channel_wrapper (dispatch));
+
+	if (empathy_dispatch_operation_claim (dispatch)) {
+		empathy_chat_set_tp_chat (chat, tpchat);
+	}
+}
+
+static void
 chat_connection_changed_cb (EmpathyAccountManager *manager,
 			    McAccount *account,
 			    TpConnectionStatusReason reason,
@@ -187,10 +207,13 @@
 		switch (priv->handle_type) {
 			case TP_HANDLE_TYPE_CONTACT:
 				empathy_dispatcher_chat_with_contact_id (account, priv->id,
-					NULL, NULL);
+					chat_connect_channel_reconnected,
+					chat);
 				break;
 			case TP_HANDLE_TYPE_ROOM:
-				empathy_dispatcher_join_muc (account, priv->id, NULL, NULL);
+				empathy_dispatcher_join_muc (account, priv->id,
+					chat_connect_channel_reconnected,
+					chat);
 				break;
 			default:
 				g_assert_not_reached ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]