commit b1bbf355def42e1c0a37539cdc235974874052ae
parent d7a2064786a8d97b4f49353fb4333eaed4687b04
Author: William Casarin <jb55@jb55.com>
Date: Wed, 3 Jan 2024 14:44:19 -0800
nostrdb/subs: notify on profile notes as well
We missed this in the original subscription code
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git 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,