[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 01/02: modified reducer to return UserAttributesAddedS
From: |
gnunet |
Subject: |
[taler-anastasis] 01/02: modified reducer to return UserAttributesAddedState |
Date: |
Thu, 17 Sep 2020 15:29:39 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
commit 8a3872fd90d9321bdaf90226451e63a02583ea8d
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Thu Sep 17 14:00:26 2020 +0200
modified reducer to return UserAttributesAddedState
---
src/lib/anastasis_api_backup_redux.c | 47 +++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/src/lib/anastasis_api_backup_redux.c
b/src/lib/anastasis_api_backup_redux.c
index 65455fb..6b6f05e 100644
--- a/src/lib/anastasis_api_backup_redux.c
+++ b/src/lib/anastasis_api_backup_redux.c
@@ -240,13 +240,14 @@ select_continent (const json_t *state,
"backup-state",
json_string ("ReduxContinentSelectedState"));
- json_object_set_new (new_state,
- "countries",
- countries);
- // optional:
json_object_set_new (new_state,
"selected_continent",
continent);
+
+ json_object_set_new (new_state,
+ "countries",
+ countries);
+
cb (cb_cls,
ANASTASIS_EC_NONE,
new_state);
@@ -319,7 +320,45 @@ enter_user_attributes (const json_t *state,
ANASTASIS_ActionCallback cb,
void *cb_cls)
{
+ json_t *new_state;
+ json_t *attributes = json_object_get (arguments, "identity");
+ if (NULL == state)
+ {
+ GNUNET_break (0);
+ cb (cb_cls,
+ ANASTASIS_EC_INVALID, // FIXME: Define correct error code
+ NULL);
+ }
+ if (NULL == attributes)
+ {
+ GNUNET_break (0);
+ cb (cb_cls,
+ ANASTASIS_EC_INVALID, // FIXME: Define correct error code
+ NULL);
+ }
+
+ new_state = json_deep_copy (state);
+ if (NULL == new_state)
+ {
+ GNUNET_break (0);
+ cb (cb_cls,
+ ANASTASIS_EC_INVALID, // FIXME: Define correct error code
+ NULL);
+ }
+
+ json_object_set (new_state,
+ "backup-state",
+ json_string ("ReduxUserAttributesAddedState"));
+
+ json_object_set_new (new_state,
+ "identity_attributes",
+ attributes);
+
+ cb (cb_cls,
+ ANASTASIS_EC_NONE,
+ new_state);
+ json_decref (new_state);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.