[Telepathy-commits] [telepathy-salut/master] pass all the properties to salut_file_transfer_channel_new

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Mar 16 09:09:31 PDT 2009


---
 src/salut-file-transfer-channel.c |   18 +++++++++++++++++-
 src/salut-file-transfer-channel.h |    5 ++++-
 src/salut-ft-manager.c            |   16 +++-------------
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/src/salut-file-transfer-channel.c b/src/salut-file-transfer-channel.c
index ea5ac57..4d7d6f6 100644
--- a/src/salut-file-transfer-channel.c
+++ b/src/salut-file-transfer-channel.c
@@ -1523,7 +1523,15 @@ salut_file_transfer_channel_new (SalutConnection *conn,
                                  TpHandle handle,
                                  SalutXmppConnectionManager *xcm,
                                  TpHandle initiator_handle,
-                                 TpFileTransferState state)
+                                 TpFileTransferState state,
+                                 const gchar *content_type,
+                                 const gchar *filename,
+                                 guint64 size,
+                                 TpFileHashType content_hash_type,
+                                 const gchar *content_hash,
+                                 const gchar *description,
+                                 guint64 date,
+                                 guint64 initial_offset)
 {
   return g_object_new (SALUT_TYPE_FILE_TRANSFER_CHANNEL,
       "connection", conn,
@@ -1533,6 +1541,14 @@ salut_file_transfer_channel_new (SalutConnection *conn,
       "xmpp-connection-manager", xcm,
       "initiator-handle", initiator_handle,
       "state", state,
+      "content-type", content_type,
+      "filename", filename,
+      "size", size,
+      "content-hash-type", content_hash_type,
+      "content-hash", content_hash,
+      "description", description,
+      "date", date,
+      "initial-offset", initial_offset,
       NULL);
 }
 
diff --git a/src/salut-file-transfer-channel.h b/src/salut-file-transfer-channel.h
index b569ae5..3a6bb72 100644
--- a/src/salut-file-transfer-channel.h
+++ b/src/salut-file-transfer-channel.h
@@ -77,7 +77,10 @@ gboolean salut_file_transfer_channel_offer_file (SalutFileTransferChannel *self,
 SalutFileTransferChannel * salut_file_transfer_channel_new (
     SalutConnection *conn, SalutContact *contact, const gchar *path,
     TpHandle handle, SalutXmppConnectionManager *xcm, TpHandle initiator_handle,
-    TpFileTransferState state);
+    TpFileTransferState state, const gchar *content_type,
+    const gchar *filename, guint64 size, TpFileHashType hash_type,
+    const gchar *content_hash, const gchar *description, guint64 date,
+    guint64 initial_offset);
 
 SalutFileTransferChannel * salut_file_transfer_channel_new_from_stanza (
     SalutConnection *connection, SalutContact *contact, const gchar *path,
diff --git a/src/salut-ft-manager.c b/src/salut-ft-manager.c
index 4d53920..19d2162 100644
--- a/src/salut-ft-manager.c
+++ b/src/salut-ft-manager.c
@@ -426,19 +426,9 @@ salut_ft_manager_handle_request (TpChannelManager *manager,
   path = generate_object_path (self, handle);
 
   chan = salut_file_transfer_channel_new (priv->connection, contact, path,
-      handle, priv->xmpp_connection_manager,  base_connection->self_handle,
-      TP_FILE_TRANSFER_STATE_PENDING);
-
-  g_object_set (chan,
-      "content-type", content_type,
-      "filename", filename,
-      "size", size,
-      "content-hash-type", content_hash_type,
-      "content-hash", content_hash,
-      "description", description,
-      "date", date,
-      "initial-offset", initial_offset,
-      NULL);
+      handle, priv->xmpp_connection_manager, base_connection->self_handle,
+      TP_FILE_TRANSFER_STATE_PENDING, content_type, filename, size,
+      content_hash_type, content_hash, description, date, initial_offset);
 
   g_free (path);
   g_object_unref (contact);
-- 
1.5.6.5




More information about the telepathy-commits mailing list