diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-09-15 06:21:17 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-09-15 06:29:34 +0800 |
commit | c1b66fcb4e53cfa4207510541f2144ca605a5d98 (patch) | |
tree | 3a97a8c3867a8b0691715eb14d433585c09fe030 | |
parent | c5f8856f80196642a8df35af72160ce9b260efdd (diff) | |
download | gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.tar gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.tar.gz gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.tar.bz2 gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.tar.lz gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.tar.xz gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.tar.zst gsoc2013-empathy-c1b66fcb4e53cfa4207510541f2144ca605a5d98.zip |
Correctly split and sanity check dropped contacts
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 3424e8dc1..184f88a02 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -246,13 +246,13 @@ contact_list_view_drag_data_received (GtkWidget *view, EmpathyContactListViewPriv *priv; EmpathyAccountManager *account_manager; EmpathyTpContactFactory *factory = NULL; - EmpathyAccount *account; + EmpathyAccount *account = NULL; GtkTreeModel *model; GtkTreeViewDropPosition position; GtkTreePath *path; const gchar *id; gchar **strv = NULL; - const gchar *account_id; + const gchar *account_id = NULL; const gchar *contact_id; gchar *new_group = NULL; gchar *old_group = NULL; @@ -298,11 +298,13 @@ contact_list_view_drag_data_received (GtkWidget *view, context->action == GDK_ACTION_COPY ? "copy" : "", id); - strv = g_strsplit (id, "/", 2); - account_id = strv[0]; - contact_id = strv[1]; - account_manager = empathy_account_manager_dup_singleton (); - account = empathy_account_manager_get_account (account_manager, account_id); + account_manager = empathy_account_manager_dup_singleton (); + strv = g_strsplit (id, ":", 2); + if (g_strv_length (strv) == 2) { + account_id = strv[0]; + contact_id = strv[1]; + account = empathy_account_manager_get_account (account_manager, account_id); + } if (account) { TpConnection *connection; |