]> git.0d.be Git - empathy.git/commitdiff
UOA auth: factor out auth_context_done()
authorXavier Claessens <xavier.claessens@collabora.co.uk>
Thu, 23 Aug 2012 13:01:16 +0000 (15:01 +0200)
committerXavier Claessens <xavier.claessens@collabora.co.uk>
Mon, 27 Aug 2012 13:47:21 +0000 (15:47 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=680776

libempathy/empathy-uoa-auth-handler.c

index 7ef435f8531a36c33a598d9ddb2996433995ca51..f88acf1202da8192a9388dd7eb07507e744f0b1a 100644 (file)
@@ -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;
     }