[empathy] factor out empathy_call_factory_create_request



commit 17810b94827e9103136ea2cf9192629eebe689b0
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Aug 9 14:53:08 2010 +0200

    factor out empathy_call_factory_create_request

 libempathy/empathy-call-factory.c |   31 ++++++++++++++++++++-----------
 libempathy/empathy-call-factory.h |    4 ++++
 2 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c
index 0021b39..8d46310 100644
--- a/libempathy/empathy-call-factory.c
+++ b/libempathy/empathy-call-factory.c
@@ -188,6 +188,24 @@ empathy_call_factory_get (void)
   return EMPATHY_CALL_FACTORY (call_factory);
 }
 
+GHashTable *
+empathy_call_factory_create_request (EmpathyContact *contact,
+    gboolean initial_audio,
+    gboolean initial_video)
+{
+  return tp_asv_new (
+      TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+        TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
+      TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
+      TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT,
+        empathy_contact_get_handle (contact),
+      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN,
+        initial_audio,
+      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN,
+        initial_video,
+      NULL);
+}
+
 /**
  * empathy_call_factory_new_call_with_streams:
  * @factory: an #EmpathyCallFactory
@@ -208,17 +226,8 @@ empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
   EmpathyDispatcher *dispatcher;
   GHashTable *request;
 
-  request = tp_asv_new (
-      TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
-        TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
-      TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
-      TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT,
-        empathy_contact_get_handle (contact),
-      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN,
-        initial_audio,
-      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN,
-        initial_video,
-      NULL);
+  request = empathy_call_factory_create_request (contact, initial_audio,
+      initial_video);
 
   dispatcher = empathy_dispatcher_dup_singleton ();
 
diff --git a/libempathy/empathy-call-factory.h b/libempathy/empathy-call-factory.h
index abd8c92..aa2175a 100644
--- a/libempathy/empathy-call-factory.h
+++ b/libempathy/empathy-call-factory.h
@@ -75,6 +75,10 @@ void empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
 gboolean empathy_call_factory_register (EmpathyCallFactory *self,
     GError **error);
 
+GHashTable * empathy_call_factory_create_request (EmpathyContact *contact,
+    gboolean initial_audio,
+    gboolean initial_video);
+
 G_END_DECLS
 
 #endif /* #ifndef __EMPATHY_CALL_FACTORY_H__*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]