From b1bbf355def42e1c0a37539cdc235974874052ae Mon Sep 17 00:00:00 2001 From: William Casarin Date: Wed, 3 Jan 2024 14:44:19 -0800 Subject: [PATCH] nostrdb/subs: notify on profile notes as well We missed this in the original subscription code Signed-off-by: William Casarin --- nostrdb/src/nostrdb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c index 767644f0..b589f2d3 100644 --- a/nostrdb/src/nostrdb.c +++ b/nostrdb/src/nostrdb.c @@ -2961,6 +2961,15 @@ static void *ndb_writer_thread(void *data) note_nkey = ndb_write_note(&txn, &msg->note, scratch, scratch_size); + if (note_nkey > 0) { + written_notes[num_notes++] = + (struct written_note){ + .note_id = note_nkey, + .note = &msg->note, + }; + } else { + ndb_debug("failed to write note\n"); + } if (msg->profile.record.builder) { // only write if parsing didn't fail ndb_write_profile(&txn, &msg->profile,