empathy r2814 - trunk/libempathy-gtk
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2814 - trunk/libempathy-gtk
- Date: Mon, 13 Apr 2009 08:21:26 +0000 (UTC)
Author: xclaesse
Date: Mon Apr 13 08:21:26 2009
New Revision: 2814
URL: http://svn.gnome.org/viewvc/empathy?rev=2814&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:
trunk/libempathy-gtk/empathy-chat.c
Modified: trunk/libempathy-gtk/empathy-chat.c
==============================================================================
--- trunk/libempathy-gtk/empathy-chat.c (original)
+++ trunk/libempathy-gtk/empathy-chat.c Mon Apr 13 08:21:26 2009
@@ -168,6 +168,28 @@
}
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 @@
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]