fumi-core #1

Merged
randogoth merged 6 commits from fumi-core into main 2026-09-29 18:16:39 +00:00
Showing only changes of commit d7179694a6 - Show all commits

View file

@ -887,12 +887,21 @@ pub extern "C" fn smol_contact(store: *mut Store, address: *const c_char) -> *mu
let address = text(address)?;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
// History entries serialize as objects, matching smol_contacts and
// the facade's parser — a bare tuple would cross the FFI as a JSON
// array and break the first contact that ever gains rotation history.
struct History {
key: String,
until: i64,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct Out {
key: String,
verified: bool,
active: Option<bool>,
accepted_key: Option<String>,
history: Vec<(String, i64)>,
history: Vec<History>,
}
let Some((key, verified)) = store.contact(address)? else {
return Ok(ser(&Out {
@ -913,7 +922,7 @@ pub extern "C" fn smol_contact(store: *mut Store, address: *const c_char) -> *mu
history: store
.history(address)?
.into_iter()
.map(|(key, until)| (b32(&key), until))
.map(|(key, until)| History { key: b32(&key), until })
.collect(),
})?)
})