From e77ec8904ba6c4372c978ac51ce67d79dd90b869 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Mon, 16 May 2011 16:43:59 +0100 Subject: [PATCH] Implement empathy_call_handler_start_call() for redialing --- src/empathy-call-handler.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c index cf9c1b03..18d0d1f9 100644 --- a/src/empathy-call-handler.c +++ b/src/empathy-call-handler.c @@ -30,11 +30,13 @@ #include +#include #include #include +#include + #include "empathy-call-handler.h" -#include "empathy-call-factory.h" #include "src-marshal.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP @@ -899,7 +901,6 @@ on_call_accepted_cb (GObject *source_object, } } -#if 0 static void empathy_call_handler_request_cb (GObject *source, GAsyncResult *result, @@ -927,21 +928,26 @@ empathy_call_handler_request_cb (GObject *source, } priv->call = TPY_CALL_CHANNEL (channel); + tp_g_signal_connect_object (priv->call, "state-changed", + G_CALLBACK (on_call_state_changed_cb), self, 0); + tp_g_signal_connect_object (priv->call, "invalidated", + G_CALLBACK (on_call_invalidated_cb), self, 0); g_object_notify (G_OBJECT (self), "call-channel"); empathy_call_handler_start_tpfs (self); + tpy_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL); } -#endif void empathy_call_handler_start_call (EmpathyCallHandler *handler, gint64 timestamp) { EmpathyCallHandlerPriv *priv = GET_PRIV (handler); -/*TpAccountChannelRequest *req; + EmpathyChannelFactory *channel_factory; + TpAccountChannelRequest *req; TpAccount *account; - GHashTable *request;*/ + GHashTable *request; if (priv->call != NULL) { @@ -949,27 +955,27 @@ empathy_call_handler_start_call (EmpathyCallHandler *handler, tpy_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL); return; } - else - { - g_warning ("No Call channel!"); - } -#if 0 /* No TpyCallChannel (we are redialing). Request a new call channel */ g_assert (priv->contact != NULL); account = empathy_contact_get_account (priv->contact); - request = empathy_call_create_call_request (priv->contact, + request = empathy_call_create_call_request ( + empathy_contact_get_id (priv->contact), priv->initial_audio, priv->initial_video); req = tp_account_channel_request_new (account, request, timestamp); + channel_factory = empathy_channel_factory_dup (); + tp_account_channel_request_set_channel_factory (req, + TP_CLIENT_CHANNEL_FACTORY (channel_factory)); + g_object_unref (channel_factory); + tp_account_channel_request_create_and_handle_channel_async (req, NULL, empathy_call_handler_request_cb, handler); g_object_unref (req); g_hash_table_unref (request); -#endif } /** -- 2.39.2