From 6628a5c4205b1c261ac6cc0b3d145af22f4d31bb Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 3 Aug 2022 23:52:13 +0000 Subject: [PATCH] What's the point of creating an identity if you don't return it? git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3948 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.js.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ssb.js.c b/src/ssb.js.c index 34538ef6..25d5c7b9 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -31,7 +31,13 @@ static JSValue _tf_ssb_createIdentity(JSContext* context, JSValueConst this_val, char public[512]; char private[512]; tf_ssb_generate_keys_buffer(public, sizeof(public), private, sizeof(private)); - if (!tf_ssb_db_identity_add(ssb, user, public, private)) + if (tf_ssb_db_identity_add(ssb, user, public, private)) + { + char id[513]; + snprintf(id, sizeof(id), "@%s", public); + result = JS_NewString(context, id); + } + else { result = JS_ThrowInternalError(context, "Unable to add identity."); }