summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-16 16:43:59 +0100
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-16 16:43:59 +0100
commit05a9128cd6195bcbde89dfc19df9dc33f449538c (patch)
tree182f094ab082dbd7ef9ed8b0216c6c9ec3c9f327
parentaebcfd442a1976d2f249445f4d56e791723552c4 (diff)
downloadempathy-05a9128cd6195bcbde89dfc19df9dc33f449538c.tar.gz
Implement empathy_call_handler_start_call() for redialing
-rw-r--r--src/empathy-call-handler.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c
index be46bd7ff..82fd68c1b 100644
--- a/src/empathy-call-handler.c
+++ b/src/empathy-call-handler.c
@@ -30,11 +30,13 @@
#include <telepathy-farstream/telepathy-farstream.h>
+#include <libempathy/empathy-channel-factory.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-tp-contact-factory.h>
+#include <libempathy-gtk/empathy-call-utils.h>
+
#include "empathy-call-handler.h"
-#include "empathy-call-factory.h"
#include "src-marshal.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
@@ -904,7 +906,6 @@ on_call_accepted_cb (GObject *source_object,
}
}
-#if 0
static void
empathy_call_handler_request_cb (GObject *source,
GAsyncResult *result,
@@ -932,21 +933,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)
{
@@ -954,27 +960,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
}
/**