From 9ce89862ae5bead69519f3238794ffbf3988dcf9 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 23 Aug 2012 15:01:16 +0200 Subject: UOA auth: factor out auth_context_done() https://bugzilla.gnome.org/show_bug.cgi?id=680776 --- libempathy/empathy-uoa-auth-handler.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-uoa-auth-handler.c b/libempathy/empathy-uoa-auth-handler.c index 7ef435f85..f88acf120 100644 --- a/libempathy/empathy-uoa-auth-handler.c +++ b/libempathy/empathy-uoa-auth-handler.c @@ -116,6 +116,13 @@ auth_context_free (AuthContext *ctx) g_slice_free (AuthContext, ctx); } +static void +auth_context_done (AuthContext *ctx) +{ + tp_channel_close_async (ctx->channel, NULL, NULL); + auth_context_free (ctx); +} + static void auth_cb (GObject *source, GAsyncResult *result, @@ -153,8 +160,7 @@ auth_cb (GObject *source, DEBUG ("Auth on %s suceeded", tp_proxy_get_object_path (channel)); } - tp_channel_close_async (channel, NULL, NULL); - auth_context_free (ctx); + auth_context_done (ctx); } static void @@ -170,8 +176,7 @@ session_process_cb (SignonAuthSession *session, if (error != NULL) { DEBUG ("Error processing the session: %s", error->message); - tp_channel_close_async (ctx->channel, NULL, NULL); - auth_context_free (ctx); + auth_context_done (ctx); return; } @@ -215,8 +220,7 @@ identity_query_info_cb (SignonIdentity *identity, if (error != NULL) { DEBUG ("Error querying info from identity: %s", error->message); - tp_channel_close_async (ctx->channel, NULL, NULL); - auth_context_free (ctx); + auth_context_done (ctx); return; } -- cgit v1.2.3