summaryrefslogtreecommitdiff
path: root/src/muc-factory.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-05-06 18:09:47 +0100
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-05-06 18:09:47 +0100
commit6a1acd2cd7066ca9006177c3558680b1a5faa8cf (patch)
treebd0ba80e188a65b11115cefa51191b2a60907751 /src/muc-factory.c
parent6b06a01a8c9f49c25d872c0215ac1b75fe1528ed (diff)
Don't let the async operation try to remember the request token
Diffstat (limited to 'src/muc-factory.c')
-rw-r--r--src/muc-factory.c22
1 files changed, 18 insertions, 4 deletions
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;