diff options
Diffstat (limited to 'telepathy-glib/channel.c')
-rw-r--r-- | telepathy-glib/channel.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index a943e588e..63943ec5b 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -1889,21 +1889,20 @@ tp_channel_join_finish (TpChannel *self, _tp_implement_finish_void (self, tp_channel_join_async); } -/* tp_cli callbacks can potentially be called in a re-entrant way, - * so we can't necessarily complete @result without using an idle. */ static void -channel_close_cb (TpChannel *channel, - const GError *error, - gpointer user_data, - GObject *weak_object) +channel_close_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) { GSimpleAsyncResult *result = user_data; + TpChannel *self = TP_CHANNEL (g_async_result_get_source_object (user_data)); + GError *error = NULL; - if (error != NULL) + if (!tp_cli_channel_close_finish (self, res, &error)) { DEBUG ("Close() failed: %s", error->message); - if (tp_proxy_get_invalidated (channel) == NULL) + if (tp_proxy_get_invalidated (self) == NULL) { g_simple_async_result_set_from_error (result, error); } @@ -1911,9 +1910,11 @@ channel_close_cb (TpChannel *channel, { DEBUG ("... but channel was already invalidated, so never mind"); } + + g_error_free (error); } - g_simple_async_result_complete_in_idle (result); + g_simple_async_result_complete (result); g_object_unref (result); } @@ -1934,8 +1935,8 @@ channel_remove_self_cb (TpChannel *channel, DEBUG ("RemoveMembersWithDetails() with self handle failed; call Close()" " %s", error->message); - tp_cli_channel_call_close (channel, -1, channel_close_cb, result, - NULL, NULL); + tp_cli_channel_close_async (channel, NULL, NULL, channel_close_cb, + result); return; } @@ -2015,8 +2016,8 @@ group_prepared_cb (GObject *source, return; call_close: - tp_cli_channel_call_close (self, -1, channel_close_cb, - g_object_ref (ctx->result), NULL, NULL); + tp_cli_channel_close_async (self, NULL, NULL, channel_close_cb, + g_object_ref (ctx->result)); leave_ctx_free (ctx); } @@ -2065,8 +2066,8 @@ tp_channel_leave_async (TpChannel *self, { DEBUG ("Channel doesn't implement Group; fallback to Close()"); - tp_cli_channel_call_close (self, -1, channel_close_cb, result, - NULL, NULL); + tp_cli_channel_close_async (self, NULL, NULL, channel_close_cb, + result); return; } @@ -2130,8 +2131,7 @@ tp_channel_close_async (TpChannel *self, result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_close_async); - tp_cli_channel_call_close (self, -1, channel_close_cb, result, - NULL, NULL); + tp_cli_channel_close_async (self, NULL, NULL, channel_close_cb, result); } /** @@ -2167,8 +2167,8 @@ channel_destroy_cb (TpChannel *channel, { DEBUG ("Destroy() failed; call Close(): %s", error->message); - tp_cli_channel_call_close (channel, -1, channel_close_cb, result, - NULL, NULL); + tp_cli_channel_close_async (channel, NULL, NULL, channel_close_cb, + result); return; } @@ -2210,8 +2210,8 @@ tp_channel_destroy_async (TpChannel *self, { DEBUG ("Channel doesn't implement Destroy; fallback to Close()"); - tp_cli_channel_call_close (self, -1, channel_close_cb, result, - NULL, NULL); + tp_cli_channel_close_async (self, NULL, NULL, channel_close_cb, + result); return; } |