[epiphany/wip/ephy-sync: 42/52] sync-service: Better name for JsonObject



commit ab5b8066ee950d4a0443fcca75ebf77ccd0bd6b2
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Fri Jul 22 19:17:08 2016 +0300

    sync-service: Better name for JsonObject

 src/ephy-sync-service.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index 2feb32b..e3523b8 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -161,7 +161,7 @@ session_destroyed_cb (SoupSession *session,
 {
   JsonParser *parser;
   JsonNode *root;
-  JsonObject *object;
+  JsonObject *json;
 
   if (message->status_code == STATUS_OK) {
     LOG ("Session destroyed");
@@ -171,11 +171,11 @@ session_destroyed_cb (SoupSession *session,
   parser = json_parser_new ();
   json_parser_load_from_data (parser, message->response_body->data, -1, NULL);
   root = json_parser_get_root (parser);
-  object = json_node_get_object (root);
+  json = json_node_get_object (root);
 
   g_warning ("Failed to destroy session: errno: %ld, errmsg: %s",
-             json_object_get_int_member (object, "errno"),
-             json_object_get_string_member (object, "message"));
+             json_object_get_int_member (json, "errno"),
+             json_object_get_string_member (json, "message"));
 
   g_object_unref (parser);
 }
@@ -279,7 +279,7 @@ check_certificate (EphySyncService *self,
 {
   JsonParser *parser;
   JsonNode *root;
-  JsonObject *object;
+  JsonObject *json;
   JsonObject *principal;
   gchar **pieces;
   gchar *header;
@@ -300,8 +300,8 @@ check_certificate (EphySyncService *self,
   parser = json_parser_new ();
   json_parser_load_from_data (parser, header, -1, NULL);
   root = json_parser_get_root (parser);
-  object = json_node_get_object (root);
-  algorithm = json_object_get_string_member (object, "alg");
+  json = json_node_get_object (root);
+  algorithm = json_object_get_string_member (json, "alg");
 
   if (g_str_equal (algorithm, "RS256") == FALSE) {
     g_warning ("Expected algorithm RS256, found %s. Giving up.", algorithm);
@@ -310,8 +310,8 @@ check_certificate (EphySyncService *self,
 
   json_parser_load_from_data (parser, payload, -1, NULL);
   root = json_parser_get_root (parser);
-  object = json_node_get_object (root);
-  principal = json_object_get_object_member (object, "principal");
+  json = json_node_get_object (root);
+  principal = json_object_get_object_member (json, "principal");
   email = json_object_get_string_member (principal, "email");
   uid_email = g_strdup_printf ("%s@%s",
                                self->uid,
@@ -322,7 +322,7 @@ check_certificate (EphySyncService *self,
     goto out;
   }
 
-  self->last_auth_at = json_object_get_int_member (object, "fxa-lastAuthAt");
+  self->last_auth_at = json_object_get_int_member (json, "fxa-lastAuthAt");
   retval = TRUE;
 
 out:
@@ -342,7 +342,7 @@ query_token_server (EphySyncService *self,
   SoupMessage *message;
   JsonParser *parser;
   JsonNode *root;
-  JsonObject *object;
+  JsonObject *json;
   guint8 *kB;
   gchar *hashed_kB;
   gchar *client_state;
@@ -370,12 +370,12 @@ query_token_server (EphySyncService *self,
                               message->response_body->data,
                               -1, NULL);
   root = json_parser_get_root (parser);
-  object = json_node_get_object (root);
+  json = json_node_get_object (root);
 
   if (message->status_code == STATUS_OK) {
-    self->storage_endpoint = g_strdup (json_object_get_string_member (object, "api_endpoint"));
-    self->token_server_id = g_strdup (json_object_get_string_member (object, "id"));
-    self->token_server_key = g_strdup (json_object_get_string_member (object, "key"));
+    self->storage_endpoint = g_strdup (json_object_get_string_member (json, "api_endpoint"));
+    self->token_server_id = g_strdup (json_object_get_string_member (json, "id"));
+    self->token_server_key = g_strdup (json_object_get_string_member (json, "key"));
   } else if (message->status_code == 400) {
     g_warning ("Failed to talk to the Token Server: malformed request");
     goto out;
@@ -386,8 +386,8 @@ query_token_server (EphySyncService *self,
     const gchar *status;
     const gchar *description;
 
-    status = json_object_get_string_member (object, "status");
-    array = json_object_get_array_member (object, "errors");
+    status = json_object_get_string_member (json, "status");
+    array = json_object_get_array_member (json, "errors");
     node = json_array_get_element (array, 0);
     errors = json_node_get_object (node);
     description = json_object_get_string_member (errors, "description");


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