From 373d7427510b8e1ab826ff7166a2b87016a7e6d5 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 15 Feb 2025 08:19:23 -0500 Subject: [PATCH] ssb: The docs show the response to invite.use() wrapped in {key: ..., value: ...}, so do that. --- src/ssb.rpc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index 006c0c0f3..5647564ab 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -1777,8 +1777,14 @@ static void _tf_ssb_invite_use_message_store_callback(const char* id, bool verif tf_ssb_connection_t* connection = work->connection; if (verified && is_new) { - tf_ssb_connection_rpc_send( - connection, k_ssb_rpc_flag_json | k_ssb_rpc_flag_end_error, -work->request_number, NULL, (const uint8_t*)work->message, strlen(work->message), NULL, NULL, NULL); + tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection); + JSContext* context = tf_ssb_get_context(ssb); + JSValue payload = JS_NewObject(context); + JSValue message = JS_ParseJSON(context, work->message, strlen(work->message), NULL); + JS_SetPropertyStr(context, payload, "key", JS_NewString(context, id)); + JS_SetPropertyStr(context, payload, "value", message); + tf_ssb_connection_rpc_send_json(connection, k_ssb_rpc_flag_end_error, -work->request_number, NULL, payload, NULL, NULL, NULL); + JS_FreeValue(context, payload); } else {