Compare commits

...

1 Commits

Author SHA1 Message Date
Laan Tungir
fac0ce6503 v0.0.13 - Fix selector parsing to use last params element for nostr_index options 2026-05-04 08:03:17 -04:00
3 changed files with 10 additions and 4 deletions

View File

@@ -584,7 +584,10 @@ char *dispatcher_handle_request(dispatcher_ctx_t *ctx, const char *json_request)
selector_request_init(&selector_req);
options_item = cJSON_GetArrayItem(params_item, 1);
{
int params_count = cJSON_GetArraySize(params_item);
options_item = (params_count > 0) ? cJSON_GetArrayItem(params_item, params_count - 1) : NULL;
}
if (cJSON_IsObject(options_item)) {
tmp = cJSON_GetObjectItemCaseSensitive(options_item, "role");
if (tmp != NULL) {

View File

@@ -451,8 +451,8 @@ int socket_name_random(char *out, size_t out_len);
/* Version information (auto-updated by build/version tooling) */
#define NSIGNER_VERSION_MAJOR 0
#define NSIGNER_VERSION_MINOR 0
#define NSIGNER_VERSION_PATCH 12
#define NSIGNER_VERSION "v0.0.12"
#define NSIGNER_VERSION_PATCH 13
#define NSIGNER_VERSION "v0.0.13"
/* NSIGNER_HEADERLESS_DECLS_END */

View File

@@ -831,7 +831,10 @@ static int extract_method_and_selector(const char *json,
params_item = cJSON_GetObjectItemCaseSensitive(root, "params");
if (cJSON_IsArray(params_item)) {
options_item = cJSON_GetArrayItem(params_item, 1);
{
int params_count = cJSON_GetArraySize(params_item);
options_item = (params_count > 0) ? cJSON_GetArrayItem(params_item, params_count - 1) : NULL;
}
if (cJSON_IsObject(options_item)) {
tmp = cJSON_GetObjectItemCaseSensitive(options_item, "role");
if (cJSON_IsString(tmp) && tmp->valuestring != NULL) {