summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-09-08 13:43:25 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-09-08 13:55:37 +0100
commitc0ad2048de760b16649649de88bbe4e49caed971 (patch)
tree276c5f97c9391a2aef238783eec3d4b594f2c9b0
parent39bf66ec9139ff04a6e6017319f941ba601a3741 (diff)
channel: add new_with_factory function
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--docs/reference/telepathy-ytstenut-glib-sections.txt1
-rw-r--r--telepathy-ytstenut-glib/channel.c33
-rw-r--r--telepathy-ytstenut-glib/channel.h5
3 files changed, 38 insertions, 1 deletions
diff --git a/docs/reference/telepathy-ytstenut-glib-sections.txt b/docs/reference/telepathy-ytstenut-glib-sections.txt
index afb6824..6fbca6d 100644
--- a/docs/reference/telepathy-ytstenut-glib-sections.txt
+++ b/docs/reference/telepathy-ytstenut-glib-sections.txt
@@ -111,6 +111,7 @@ TP_YTS_SVC_STATUS_GET_CLASS
TpYtsChannel
TpYtsChannelClass
tp_yts_channel_new_from_properties
+tp_yts_channel_new_with_factory
tp_yts_channel_request_async
tp_yts_channel_request_finish
tp_yts_channel_reply_async
diff --git a/telepathy-ytstenut-glib/channel.c b/telepathy-ytstenut-glib/channel.c
index 07de6c9..029f0e6 100644
--- a/telepathy-ytstenut-glib/channel.c
+++ b/telepathy-ytstenut-glib/channel.c
@@ -270,16 +270,46 @@ tp_yts_channel_class_init (TpYtsChannelClass *klass)
* @immutable_properties: The immutable properties of the channel.
* @error: If not %NULL, used to raise an error when %NULL is returned.
*
+ * The same as tp_yts_channel_with_factory() but without the client
+ * factory.
+ *
+ * This function should not be used. tp_yts_channel_with_factory()
+ * should be used with an appropriate client factory.
+ *
+ * Returns: A newly allocated #TpYtsChannel object.
+ */
+TpChannel *
+tp_yts_channel_new_from_properties (TpConnection *conn,
+ const gchar *object_path,
+ GHashTable *immutable_properties,
+ GError **error)
+{
+ return tp_yts_channel_new_with_factory (NULL, conn, object_path,
+ immutable_properties, error);
+}
+
+/**
+ * tp_yts_channel_new_with_factory:
+ * @factory: a #TpSimpleClientFactory
+ * @conn: The telepathy connection
+ * @object_path: The DBus object path of the channel.
+ * @immutable_properties: The immutable properties of the channel.
+ * @error: If not %NULL, used to raise an error when %NULL is returned.
+ *
* Create a new #TpYtsChannel proxy object for a channel that exists in the
* Ytstenut DBus implementation.
*
* In order to request a new outgoing channel use
* tp_yts_client_request_channel_async() instead of this function.
*
+ * Note that this function should only be called for incoming channels
+ * by the client factory, @factory.
+ *
* Returns: A newly allocated #TpYtsChannel object.
*/
TpChannel *
-tp_yts_channel_new_from_properties (TpConnection *conn,
+tp_yts_channel_new_with_factory (TpSimpleClientFactory *factory,
+ TpConnection *conn,
const gchar *object_path,
GHashTable *immutable_properties,
GError **error)
@@ -301,6 +331,7 @@ tp_yts_channel_new_from_properties (TpConnection *conn,
"object-path", object_path,
"handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE,
"channel-properties", immutable_properties,
+ "factory", factory,
NULL));
finally:
diff --git a/telepathy-ytstenut-glib/channel.h b/telepathy-ytstenut-glib/channel.h
index cabacbe..c1817f6 100644
--- a/telepathy-ytstenut-glib/channel.h
+++ b/telepathy-ytstenut-glib/channel.h
@@ -27,6 +27,7 @@
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/defs.h>
#include <telepathy-glib/proxy.h>
+#include <telepathy-glib/simple-client-factory.h>
G_BEGIN_DECLS
@@ -63,6 +64,10 @@ GType tp_yts_channel_get_type (void);
TpChannel *tp_yts_channel_new_from_properties (TpConnection *conn,
const gchar *object_path, GHashTable *immutable_properties, GError **error);
+TpChannel *tp_yts_channel_new_with_factory (TpSimpleClientFactory *factory,
+ TpConnection *conn, const gchar *object_path,
+ GHashTable *immutable_properties, GError **error);
+
void tp_yts_channel_request_async (TpYtsChannel *self,
GCancellable *cancellable, GAsyncReadyCallback callback,
gpointer user_data);