aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-04-13 16:21:26 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-04-13 16:21:26 +0800
commit6eee3479f40b71b0345d30a2ff1e4879aa9eb557 (patch)
treed7794c823f11b1b736f69e5e77c8b0846d0b8717
parentd285ec3a4bc9a347d3f3583de7d9c8836772e3a0 (diff)
downloadgsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.tar
gsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.tar.gz
gsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.tar.bz2
gsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.tar.lz
gsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.tar.xz
gsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.tar.zst
gsoc2013-empathy-6eee3479f40b71b0345d30a2ff1e4879aa9eb557.zip
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> svn path=/trunk/; revision=2814
-rw-r--r--libempathy-gtk/empathy-chat.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 5f54c12eb..99d4d4c09 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -168,6 +168,28 @@ chat_set_property (GObject *object,
}
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) {
+ empathy_chat_view_append_event (chat->view,
+ _("Failed to reconnect this chat"));
+ 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 +209,13 @@ chat_connection_changed_cb (EmpathyAccountManager *manager,
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 ();