ssb: Respect blocks when getting blocks and accounts at the db level.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 8m59s

This commit is contained in:
2025-11-29 12:14:34 -05:00
parent d200e361f7
commit fb6e554e59
3 changed files with 18 additions and 28 deletions

View File

@@ -1903,12 +1903,15 @@ void tf_ssb_test_blocks(const tf_test_options_t* options)
}
JS_FreeValue(context, obj);
assert(tf_ssb_db_blob_get(ssb, blob_id, NULL, NULL));
sqlite3* db = tf_ssb_acquire_db_writer(ssb);
tf_ssb_db_add_block(db, message_id);
assert(tf_ssb_db_is_blocked(db, message_id));
/* Blocked already, because the blocked message references it. */
assert(tf_ssb_db_is_blocked(db, blob_id));
tf_ssb_db_add_block(db, blob_id);
assert(!tf_ssb_db_blob_get(ssb, blob_id, NULL, NULL));
tf_ssb_db_add_block(db, id);
assert(tf_ssb_db_is_blocked(db, id));
tf_ssb_db_remove_block(db, blob_id);
@@ -1918,6 +1921,7 @@ void tf_ssb_test_blocks(const tf_test_options_t* options)
assert(!tf_ssb_db_is_blocked(db, blob_id));
assert(!tf_ssb_db_is_blocked(db, id));
tf_ssb_release_db_writer(ssb, db);
assert(tf_ssb_db_blob_get(ssb, blob_id, NULL, NULL));
tf_ssb_destroy(ssb);