aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-10 22:44:48 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 18:27:57 +0800
commitb952de7a60106948665bc429ebc5129539d4ff2a (patch)
treecc09db1b4b356c7330ddc870646c1de7a25b6f6c /libempathy
parent3f28e2304aab16ad6d68054a19dcbfdd5c75e7c8 (diff)
downloadgsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.tar
gsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.tar.gz
gsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.tar.bz2
gsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.tar.lz
gsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.tar.xz
gsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.tar.zst
gsoc2013-empathy-b952de7a60106948665bc429ebc5129539d4ff2a.zip
call-factory: use TpAccountChannelRequest to request the media channel
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-call-factory.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c
index 06029c4bd..5f57f7c24 100644
--- a/libempathy/empathy-call-factory.c
+++ b/libempathy/empathy-call-factory.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <telepathy-glib/account-channel-request.h>
#include <telepathy-glib/simple-handler.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
@@ -31,6 +32,9 @@
#include "empathy-call-factory.h"
#include "empathy-utils.h"
+#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
+#include <libempathy/empathy-debug.h>
+
G_DEFINE_TYPE(EmpathyCallFactory, empathy_call_factory, G_TYPE_OBJECT)
static void handle_channels_cb (TpSimpleHandler *handler,
@@ -206,6 +210,21 @@ empathy_call_factory_create_request (EmpathyContact *contact,
NULL);
}
+static void
+create_media_channel_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ GError *error = NULL;
+
+ if (!tp_account_channel_request_create_channel_finish (
+ TP_ACCOUNT_CHANNEL_REQUEST (source), result, &error))
+ {
+ DEBUG ("Failed to create media channel: %s", error->message);
+ g_error_free (error);
+ }
+}
+
/**
* empathy_call_factory_new_call_with_streams:
* @factory: an #EmpathyCallFactory
@@ -222,19 +241,21 @@ empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
gint64 timestamp,
gpointer user_data)
{
- EmpathyDispatcher *dispatcher;
GHashTable *request;
+ TpAccount *account;
+ TpAccountChannelRequest *req;
request = empathy_call_factory_create_request (contact, initial_audio,
initial_video);
- dispatcher = empathy_dispatcher_dup_singleton ();
+ account = empathy_contact_get_account (contact);
+
+ req = tp_account_channel_request_new (account, request, timestamp);
- empathy_dispatcher_create_channel (dispatcher,
- empathy_contact_get_connection (contact), request, timestamp, NULL,
- user_data);
+ tp_account_channel_request_create_channel_async (req, NULL, NULL,
+ create_media_channel_cb, NULL);
- g_object_unref (dispatcher);
+ g_object_unref (req);
}
static void