[empathy] UOA auth: factor out auth_context_done()



commit 9ce89862ae5bead69519f3238794ffbf3988dcf9
Author: Xavier Claessens <xavier claessens collabora co uk>
Date:   Thu Aug 23 15:01:16 2012 +0200

    UOA auth: factor out auth_context_done()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=680776

 libempathy/empathy-uoa-auth-handler.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/libempathy/empathy-uoa-auth-handler.c b/libempathy/empathy-uoa-auth-handler.c
index 7ef435f..f88acf1 100644
--- a/libempathy/empathy-uoa-auth-handler.c
+++ b/libempathy/empathy-uoa-auth-handler.c
@@ -117,6 +117,13 @@ auth_context_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,
     gpointer user_data)
@@ -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;
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]