aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-03-04 06:25:34 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-04-22 18:21:13 +0800
commitf0308684e7442e55a88fe5588161daa5faafc365 (patch)
treeecddf7615e8615f0af24cda31dbfaa28e8e58fc3
parent0273e0ed096f3d741da47bb5e8918c3a70ede2b8 (diff)
downloadgsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.tar
gsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.tar.gz
gsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.tar.bz2
gsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.tar.lz
gsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.tar.xz
gsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.tar.zst
gsoc2013-empathy-f0308684e7442e55a88fe5588161daa5faafc365.zip
Port EmpathyChatWindow's DnD to new API
-rw-r--r--src/empathy-chat-window.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index a6ca638b8..0738f6e52 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -41,6 +41,7 @@
#include <libempathy/empathy-message.h>
#include <libempathy/empathy-dispatcher.h>
#include <libempathy/empathy-chatroom-manager.h>
+#include <libempathy/empathy-account-manager.h>
#include <libempathy/empathy-utils.h>
#include <libempathy-gtk/empathy-images.h>
@@ -1160,17 +1161,33 @@ chat_window_drag_data_received (GtkWidget *widget,
McAccount *account;
const gchar *id;
gchar **strv;
+ const gchar *account_id;
+ const gchar *contact_id;
id = (const gchar*) selection->data;
DEBUG ("DND contact from roster with id:'%s'", id);
strv = g_strsplit (id, "/", 2);
- account = mc_account_lookup (strv[0]);
- chat = empathy_chat_window_find_chat (account, strv[1]);
+ account_id = strv[0];
+ contact_id = strv[1];
+ account = mc_account_lookup (account_id);
+ chat = empathy_chat_window_find_chat (account, contact_id);
if (!chat) {
- empathy_dispatcher_chat_with_contact_id (account, strv[2], NULL, NULL);
+ EmpathyAccountManager *account_manager;
+ TpConnection *connection;
+
+ account_manager = empathy_account_manager_dup_singleton ();
+ connection = empathy_account_manager_get_connection (
+ account_manager, account);
+
+ if (connection) {
+ empathy_dispatcher_chat_with_contact_id (
+ connection, contact_id, NULL, NULL);
+ }
+
+ g_object_unref (account_manager);
g_object_unref (account);
g_strfreev (strv);
return;