empathy r2193 - in trunk: libempathy src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2193 - in trunk: libempathy src
- Date: Fri, 9 Jan 2009 16:15:43 +0000 (UTC)
Author: xclaesse
Date: Fri Jan 9 16:15:43 2009
New Revision: 2193
URL: http://svn.gnome.org/viewvc/empathy?rev=2193&view=rev
Log:
Port to the new empathy_call_when_ready api
Signed-off-by: Sjoerd Simons <sjoerd simons collabora co uk>
Modified:
trunk/libempathy/empathy-dispatcher.c
trunk/src/empathy-event-manager.c
Modified: trunk/libempathy/empathy-dispatcher.c
==============================================================================
--- trunk/libempathy/empathy-dispatcher.c (original)
+++ trunk/libempathy/empathy-dispatcher.c Fri Jan 9 16:15:43 2009
@@ -903,6 +903,22 @@
}
static void
+dispatcher_request_failed (EmpathyDispatcher *dispatcher,
+ DispatcherRequestData *request_data, const GError *error)
+{
+ EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ ConnectionData *conn_data;
+
+ conn_data = g_hash_table_lookup (priv->connections, request_data->connection);
+ if (request_data->cb != NULL)
+ request_data->cb (NULL, error, request_data->user_data);
+
+ conn_data->outstanding_requests =
+ g_list_remove (conn_data->outstanding_requests, request_data);
+ free_dispatcher_request_data (request_data);
+}
+
+static void
dispatcher_connection_new_requested_channel (EmpathyDispatcher *dispatcher,
DispatcherRequestData *request_data, const gchar *object_path,
GHashTable *properties, const GError *error)
@@ -918,12 +934,7 @@
{
DEBUG ("Channel request failed: %s", error->message);
- if (request_data->cb != NULL)
- request_data->cb (NULL, error, request_data->user_data);
-
- conn_data->outstanding_requests =
- g_list_remove (conn_data->outstanding_requests, request_data);
- free_dispatcher_request_data (request_data);
+ dispatcher_request_failed (dispatcher, request_data, error);
goto out;
}
@@ -1043,7 +1054,8 @@
static void
-dispatcher_chat_with_contact_cb (EmpathyContact *contact, gpointer user_data)
+dispatcher_chat_with_contact_cb (EmpathyContact *contact,
+ const GError *error, gpointer user_data, GObject *object)
{
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
@@ -1080,7 +1092,7 @@
empathy_contact_call_when_ready (contact,
EMPATHY_CONTACT_READY_HANDLE, dispatcher_chat_with_contact_cb,
- request_data);
+ request_data, NULL, G_OBJECT (dispatcher));
g_object_unref (dispatcher);
}
@@ -1184,13 +1196,20 @@
static void
dispatcher_create_channel_with_contact_cb (EmpathyContact *contact,
- gpointer user_data)
+ const GError *error, gpointer user_data, GObject *object)
{
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
GValue *target_handle;
g_assert (request_data->request);
+ if (error != NULL)
+ {
+ dispatcher_request_failed (request_data->dispatcher,
+ request_data, error);
+ return;
+ }
+
request_data->handle = empathy_contact_get_handle (contact);
target_handle = tp_g_value_slice_new (G_TYPE_UINT);
@@ -1265,7 +1284,7 @@
empathy_contact_call_when_ready (contact,
EMPATHY_CONTACT_READY_HANDLE, dispatcher_create_channel_with_contact_cb,
- request_data);
+ request_data, NULL, G_OBJECT (dispatcher));
g_object_unref (dispatcher);
}
Modified: trunk/src/empathy-event-manager.c
==============================================================================
--- trunk/src/empathy-event-manager.c (original)
+++ trunk/src/empathy-event-manager.c Fri Jan 9 16:15:43 2009
@@ -238,11 +238,18 @@
static void
event_manager_media_channel_got_name_cb (EmpathyContact *contact,
- gpointer user_data)
+ const GError *error, gpointer user_data, GObject *object)
{
EventManagerApproval *approval = user_data;
gchar *msg;
+ if (error != NULL)
+ {
+ /* FIXME just returning assuming the operation will be invalidated as
+ * well */
+ return;
+ }
+
msg = g_strdup_printf (_("Incoming call from %s"),
empathy_contact_get_name (contact));
@@ -258,7 +265,7 @@
{
empathy_contact_call_when_ready (approval->contact,
EMPATHY_CONTACT_READY_NAME, event_manager_media_channel_got_name_cb,
- approval);
+ approval, NULL, G_OBJECT (approval->manager));
}
static void
@@ -331,14 +338,22 @@
static void
event_manager_tube_got_contact_name_cb (EmpathyContact *contact,
- gpointer user_data)
+ const GError *error, gpointer user_data, GObject *object)
{
EventManagerApproval *approval = (EventManagerApproval *)user_data;
EmpathyTubeDispatchAbility dispatchability;
+ if (error != NULL)
+ {
+ /* FIXME?, we assume that the operation gets invalidated as well (if it
+ * didn't already */
+ return;
+ }
+
dispatchability = empathy_tube_dispatch_is_dispatchable
(approval->tube_dispatch);
+
switch (dispatchability)
{
case EMPATHY_TUBE_DISPATCHABILITY_UNKNOWN:
@@ -457,7 +472,7 @@
empathy_contact_call_when_ready (contact,
EMPATHY_CONTACT_READY_NAME, event_manager_tube_got_contact_name_cb,
- approval);
+ approval, NULL, G_OBJECT (manager));
g_object_unref (factory);
g_object_unref (account);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]