[Telepathy-commits] [telepathy-salut/master] Made sure the object path of new file channels are unique.

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Nov 21 03:46:13 PST 2008


20080730142530-8ed0e-d214e036fb5d5fbc54d6fd3998f6beaf02d5e2bd.gz
---
 src/salut-ft-manager.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/salut-ft-manager.c b/src/salut-ft-manager.c
index 764fc99..f251a75 100644
--- a/src/salut-ft-manager.c
+++ b/src/salut-ft-manager.c
@@ -267,6 +267,9 @@ salut_ft_manager_new_channel (SalutFtManager *mgr,
   gchar *path = NULL;
   guint direction, state;
 
+  /* Increasing guint to make sure object paths are random */
+  static guint id = 0;
+
   DEBUG ("Requested channel for handle: %d", handle);
 
   contact = salut_contact_manager_get_contact (priv->contact_manager, handle);
@@ -281,8 +284,11 @@ salut_ft_manager_new_channel (SalutFtManager *mgr,
   direction = incoming ? SALUT_FILE_TRANSFER_DIRECTION_INCOMING : SALUT_FILE_TRANSFER_DIRECTION_OUTGOING;
 
   name = tp_handle_inspect (handle_repo, handle);
-  path = g_strdup_printf ("%s/FileChannel/%u",
-                         base_connection->object_path, handle);
+  path = g_strdup_printf ("%s/FileChannel/%u/%u",
+                         base_connection->object_path, handle, id++);
+
+  DEBUG ("Object path of file channel is %s", path);
+
   chan = g_object_new (SALUT_TYPE_FILE_CHANNEL,
                        "connection", priv->connection,
                        "contact", contact,
-- 
1.5.6.5




More information about the Telepathy-commits mailing list