diff options
-rw-r--r-- | libempathy/empathy-dispatcher.c | 45 | ||||
-rw-r--r-- | libempathy/empathy-dispatcher.h | 3 |
2 files changed, 30 insertions, 18 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) { diff --git a/libempathy/empathy-dispatcher.h b/libempathy/empathy-dispatcher.h index d43dcf89d..1c1793f90 100644 --- a/libempathy/empathy-dispatcher.h +++ b/libempathy/empathy-dispatcher.h @@ -71,9 +71,6 @@ GType empathy_dispatcher_get_type (void) G_GNUC_CONST; /* Requesting 1 to 1 stream media channels */ void empathy_dispatcher_call_with_contact (EmpathyContact *contact, EmpathyDispatcherRequestCb *callback, gpointer user_data); -void empathy_dispatcher_call_with_contact_id (McAccount *account, - const gchar *contact_id, EmpathyDispatcherRequestCb *callback, - gpointer user_data); /* Requesting 1 to 1 text channels */ void empathy_dispatcher_chat_with_contact_id (McAccount *account, |