diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-18 17:31:10 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-18 18:15:06 +0800 |
commit | 9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416 (patch) | |
tree | 4e4cfd5b8f801acff74edfdd5072f45d7038e00b /src/empathy-chat-window.c | |
parent | 7fbf3e0c200b0a3c5086fdce0cc19afe48c429bb (diff) | |
download | gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.tar gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.tar.gz gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.tar.bz2 gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.tar.lz gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.tar.xz gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.tar.zst gsoc2013-empathy-9ddd25f8589ae0cd5ec8e09c4c012e4ccac6a416.zip |
Port to new tp-glib client factory
- EmpathyChannelFactory has been changed to EmpathyClientFactory and inherit
from TpAutomaticClientFactory.
- We now always use the _with_am variant of TpSimple* constructors
- We define our own factory as default.
- Replace empathy_get_account_for_connection() by tp_connection_get_account()
- The factory is passed to EmpathyTpChat and TpyCallChannel
- Use tp_simple_client_factory_ensure_account() instead of
tp_account_manager_ensure_account().
- Rely on the factory to prepare connection features.
This should ensure that all the TpProxy and TpContact objects created in
Empathy are shared and use EmpathyClientFactory.
https://bugzilla.gnome.org/show_bug.cgi?id=655799
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r-- | src/empathy-chat-window.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index c0a08d4dd..171b6358d 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -38,6 +38,7 @@ #include <telepathy-glib/telepathy-glib.h> +#include <libempathy/empathy-client-factory.h> #include <libempathy/empathy-contact.h> #include <libempathy/empathy-message.h> #include <libempathy/empathy-chatroom-manager.h> @@ -1827,7 +1828,7 @@ chat_window_drag_data_received (GtkWidget *widget, EmpathyChat *chat = NULL; EmpathyChatWindow *old_window; TpAccount *account = NULL; - TpAccountManager *account_manager; + EmpathyClientFactory *factory; const gchar *id; gchar **strv; const gchar *account_id; @@ -1835,9 +1836,7 @@ chat_window_drag_data_received (GtkWidget *widget, id = (const gchar*) gtk_selection_data_get_data (selection); - /* FIXME: Perhaps should be sure that the account manager is - * prepared before calling _ensure_account on it. */ - account_manager = tp_account_manager_dup (); + factory = empathy_client_factory_dup (); DEBUG ("DND contact from roster with id:'%s'", id); @@ -1846,7 +1845,11 @@ chat_window_drag_data_received (GtkWidget *widget, account_id = strv[0]; contact_id = strv[1]; account = - tp_account_manager_ensure_account (account_manager, account_id); + tp_simple_client_factory_ensure_account ( + TP_SIMPLE_CLIENT_FACTORY (factory), account_id, + NULL, NULL); + + g_object_unref (factory); if (account != NULL) chat = empathy_chat_window_find_chat (account, contact_id, FALSE); } @@ -1864,7 +1867,6 @@ chat_window_drag_data_received (GtkWidget *widget, g_strfreev (strv); return; } - g_object_unref (account_manager); g_strfreev (strv); old_window = chat_window_find_chat (chat); |