aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-06-22 17:25:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-06-22 17:59:33 +0800
commit2064d5324ec602a7a6c2e9e63d5b406e5228824c (patch)
tree37f6f9b12da536062a888570ee0d5df42885bd2e /libempathy
parent57459c6892de159e92a90231e8c10e63c566ac32 (diff)
downloadgsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar
gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.gz
gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.bz2
gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.lz
gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.xz
gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.zst
gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.zip
empathy_call_factory_new_call_with_streams: request channel using the CD
Also allow caller to pass the timestamp and an optionnal callback.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-call-factory.c41
-rw-r--r--libempathy/empathy-call-factory.h8
2 files changed, 34 insertions, 15 deletions
diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c
index 376ff91e4..65ab88359 100644
--- a/libempathy/empathy-call-factory.c
+++ b/libempathy/empathy-call-factory.c
@@ -26,6 +26,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+#include "empathy-dispatcher.h"
#include "empathy-marshal.h"
#include "empathy-call-factory.h"
#include "empathy-utils.h"
@@ -205,21 +206,33 @@ void
empathy_call_factory_new_call_with_streams (EmpathyCallFactory *factory,
EmpathyContact *contact,
gboolean initial_audio,
- gboolean initial_video)
+ gboolean initial_video,
+ gint64 timestamp,
+ EmpathyDispatcherRequestCb callback,
+ gpointer user_data)
{
- EmpathyCallHandler *handler;
-
- g_return_if_fail (factory != NULL);
- g_return_if_fail (contact != NULL);
-
- handler = empathy_call_handler_new_for_contact_with_streams (contact,
- initial_audio, initial_video);
-
- g_signal_emit (factory, signals[NEW_CALL_HANDLER], 0,
- handler, TRUE);
-
- g_object_unref (handler);
-#endif
+ 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);
+
+ dispatcher = empathy_dispatcher_dup_singleton ();
+
+ empathy_dispatcher_create_channel (dispatcher,
+ empathy_contact_get_connection (contact), request, timestamp, callback,
+ user_data);
+
+ g_object_unref (dispatcher);
}
static void
diff --git a/libempathy/empathy-call-factory.h b/libempathy/empathy-call-factory.h
index c17163dfe..b9b812b8d 100644
--- a/libempathy/empathy-call-factory.h
+++ b/libempathy/empathy-call-factory.h
@@ -25,6 +25,7 @@
#include <libempathy/empathy-dispatch-operation.h>
#include <libempathy/empathy-call-handler.h>
+#include <libempathy/empathy-dispatcher.h>
G_BEGIN_DECLS
@@ -65,7 +66,12 @@ EmpathyCallFactory *empathy_call_factory_initialise (void);
EmpathyCallFactory *empathy_call_factory_get (void);
void empathy_call_factory_new_call_with_streams (EmpathyCallFactory *factory,
- EmpathyContact *contact, gboolean initial_audio, gboolean initial_video);
+ EmpathyContact *contact,
+ gboolean initial_audio,
+ gboolean initial_video,
+ gint64 timestamp,
+ EmpathyDispatcherRequestCb callback,
+ gpointer user_data);
G_END_DECLS