From 6a1acd2cd7066ca9006177c3558680b1a5faa8cf Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Thu, 6 May 2010 18:09:47 +0100 Subject: Don't let the async operation try to remember the request token --- src/muc-channel.c | 4 ---- src/muc-channel.h | 1 - src/muc-factory.c | 22 ++++++++++++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/muc-channel.c b/src/muc-channel.c index 18d7303e4..308c98f83 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -4023,12 +4023,8 @@ gabble_muc_channel_request_call (GabbleMucChannel *gmuc, gboolean gabble_muc_channel_request_call_finish (GabbleMucChannel *gmuc, GAsyncResult *result, - gpointer *token, GError **error) { - *token = g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (result)); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; diff --git a/src/muc-channel.h b/src/muc-channel.h index 9000d4832..f8c58f900 100644 --- a/src/muc-channel.h +++ b/src/muc-channel.h @@ -125,7 +125,6 @@ void gabble_muc_channel_request_call (GabbleMucChannel *gmuc, gboolean gabble_muc_channel_request_call_finish (GabbleMucChannel *gmuc, GAsyncResult *result, - gpointer *token, GError **error); gboolean gabble_muc_channel_handle_jingle_session (GabbleMucChannel *channel, diff --git a/src/muc-factory.c b/src/muc-factory.c index 376b330c1..4889f9bf7 100644 --- a/src/muc-factory.c +++ b/src/muc-factory.c @@ -65,6 +65,11 @@ enum LAST_PROPERTY }; +typedef struct { + GabbleMucFactory *self; + gpointer token; +} Request; + struct _GabbleMucFactoryPrivate { GabbleConnection *conn; @@ -1658,13 +1663,14 @@ call_muc_channel_request_cb (GObject *source, GAsyncResult *result, gpointer user_data) { - GabbleMucFactory *self = GABBLE_MUC_FACTORY (user_data); + Request *r = user_data; + GabbleMucFactory *self = GABBLE_MUC_FACTORY (r->self); GabbleMucChannel *channel = GABBLE_MUC_CHANNEL (source); - gpointer request_token; + gpointer request_token = r->token; GError *error = NULL; if (!gabble_muc_channel_request_call_finish (channel, - result, &request_token, &error)) + result, &error)) { tp_channel_manager_emit_request_failed (self, request_token, error->domain, error->code, error->message); @@ -1673,6 +1679,9 @@ call_muc_channel_request_cb (GObject *source, /* No need to handle a successful request, this is handled when the muc * signals a new call channel automagically */ + + g_object_unref (r->self); + g_slice_free (Request, r); } static gboolean @@ -1687,6 +1696,7 @@ handle_call_channel_request (GabbleMucFactory *self, gboolean initial_audio, initial_video; GabbleMucChannel *muc; GabbleCallMucChannel *call; + Request *r; if (tp_channel_manager_asv_has_unknown_properties (request_properties, muc_channel_fixed_properties, @@ -1728,12 +1738,16 @@ handle_call_channel_request (GabbleMucFactory *self, } /* FIXME not coping properly with deinitialisation */ + r = g_slice_new (Request); + r->self = g_object_ref (self); + r->token = request_token; + gabble_muc_channel_request_call (muc, request_properties, require_new, request_token, call_muc_channel_request_cb, - self); + r); out: return TRUE; -- cgit v1.2.3