diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-01-10 00:14:07 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-10 00:14:07 +0800 |
commit | 3fc0800fa97d410b2ce39ee5b61e1a49967d4b06 (patch) | |
tree | 81716b4c39f5e9af3300c21925869273df54189b /libempathy/empathy-dispatcher.c | |
parent | a9ddf2bc00f20ac6fae42479921538950c1a8d07 (diff) | |
download | gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.tar gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.tar.gz gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.tar.bz2 gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.tar.lz gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.tar.xz gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.tar.zst gsoc2013-empathy-3fc0800fa97d410b2ce39ee5b61e1a49967d4b06.zip |
Add code to request a streamed media channel
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2164
Diffstat (limited to 'libempathy/empathy-dispatcher.c')
-rw-r--r-- | libempathy/empathy-dispatcher.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index f4510123c..119de9adf 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -89,6 +89,7 @@ typedef struct { guint handle_type; guint handle; EmpathyContact *contact; + /* Properties to pass to the channel when requesting it */ GHashTable *request; EmpathyDispatcherRequestCb *cb; @@ -1417,21 +1418,6 @@ dispatcher_request_channel_cb (TpConnection *connection, request_data, object_path, NULL, error); } -void -empathy_dispatcher_call_with_contact ( EmpathyContact *contact, - EmpathyDispatcherRequestCb *callback, gpointer user_data) -{ - g_assert_not_reached (); -} - -void -empathy_dispatcher_call_with_contact_id (McAccount *account, - const gchar *contact_id, EmpathyDispatcherRequestCb *callback, - gpointer user_data) -{ - g_assert_not_reached (); -} - static void dispatcher_request_channel (DispatcherRequestData *request_data) { @@ -1443,6 +1429,35 @@ dispatcher_request_channel (DispatcherRequestData *request_data) request_data, NULL, G_OBJECT (request_data->dispatcher)); } +void +empathy_dispatcher_call_with_contact ( EmpathyContact *contact, + EmpathyDispatcherRequestCb *callback, gpointer user_data) +{ + EmpathyDispatcher *dispatcher = empathy_get_dispatcher(); + EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher); + McAccount *account; + TpConnection *connection; + ConnectionData *cd; + DispatcherRequestData *request_data; + + account = empathy_contact_get_account (contact); + connection = g_hash_table_lookup (priv->accounts, account); + + g_assert (connection != NULL); + cd = g_hash_table_lookup (priv->connections, connection); + request_data = new_dispatcher_request_data (dispatcher, connection, + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, TP_HANDLE_TYPE_NONE, 0, NULL, + contact, callback, user_data); + + cd->outstanding_requests = g_list_prepend + (cd->outstanding_requests, request_data); + + dispatcher_request_channel (request_data); + + g_object_unref (dispatcher); +} + + static void dispatcher_chat_with_contact_cb (EmpathyContact *contact, gpointer user_data) { |