feat(fof-layer3): Mode 1 publish + read + Tauri + UI wiring
End-to-end FoFClosed (Mode 1: encrypted body + FoF comments): Node API: - create_post_fof_closed(content) -> (PostId, Post, cek) Builds gating, encrypts body via fof::encrypt_fof_body, base64s it into post.content, stores with visibility=FoFClosed + intent=Public, propagates via update_neighbor_manifests_as. - read_fof_closed_body(post_id) -> Option<String> Trial-unlocks via find_unlock_for_post, decrypts body, returns plaintext. Returns None for non-FoFClosed or non-member readers. Tauri commands: - create_post_fof_closed, read_fof_closed_body. Registered in generate_handler!. Feed rendering: - PostDto.visibility carries the new "fof-closed" string. - renderPost(): FoFClosed posts render with a locked placeholder (data-fof-closed-pending=post_id span). Visual badge added. - unlockFoFClosedPlaceholders(rootEl): post-render async pass that scans for placeholder spans and dispatches read_fof_closed_body for each. Fills in body for FoF readers; falls back to a "not in this FoF set" notice otherwise. - Wired into feed-list and my-posts-list render paths. Compose: - "Body+Comments: FoF only (Mode 1)" option in comment-perm-select. Selected → dispatches to create_post_fof_closed. CLI feed renderer + Tauri feed-DTO match arms updated to handle FoFClosed. New end-to-end test brings total to 146: - fof_closed_body_end_to_end: Alice authors FoFClosed body; Bob (with Alice's V_me in his keyring) unlocks + decrypts; Carol (no matching V_x) cannot unlock and sees only ciphertext. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
856f386231
commit
66b78041fc
6 changed files with 255 additions and 4 deletions
|
|
@ -905,6 +905,7 @@ async fn print_post(
|
|||
itsgoin_core::types::PostVisibility::GroupEncrypted { epoch, .. } => {
|
||||
format!(" [group-encrypted, epoch {}]", epoch)
|
||||
}
|
||||
itsgoin_core::types::PostVisibility::FoFClosed => " [fof-closed]".to_string(),
|
||||
};
|
||||
|
||||
let ts = post.timestamp_ms / 1000;
|
||||
|
|
@ -917,6 +918,10 @@ async fn print_post(
|
|||
Some(text) => text.to_string(),
|
||||
None => "(encrypted)".to_string(),
|
||||
},
|
||||
itsgoin_core::types::PostVisibility::FoFClosed => match decrypted {
|
||||
Some(text) => text.to_string(),
|
||||
None => "(fof-closed; not in this FoF set)".to_string(),
|
||||
},
|
||||
};
|
||||
|
||||
println!("---");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue