diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c index c2f63dc5..539215e5 100644 --- a/nostrdb/src/nostrdb.c +++ b/nostrdb/src/nostrdb.c @@ -4951,6 +4951,17 @@ int ndb_ws_event_from_json(const char *json, int len, struct ndb_tce *tce, tce->command_result.msg = json + tok->start; tce->command_result.msglen = toksize(tok); + return 1; + } else if (tok_len == 4 && !memcmp("AUTH", json + tok->start, 4)) { + tce->evtype = NDB_TCE_AUTH; + + tok = &parser.toks[parser.i++]; + if (tok->type != JSMN_STRING) + return 0; + + tce->subid = json + tok->start; + tce->subid_len = toksize(tok); + return 1; } diff --git a/nostrdb/src/nostrdb.h b/nostrdb/src/nostrdb.h index dacf1e65..4bf58ad0 100644 --- a/nostrdb/src/nostrdb.h +++ b/nostrdb/src/nostrdb.h @@ -91,6 +91,7 @@ enum tce_type { NDB_TCE_OK = 0x2, NDB_TCE_NOTICE = 0x3, NDB_TCE_EOSE = 0x4, + NDB_TCE_AUTH = 0x5, }; enum ndb_ingest_filter_action {