diff --git a/native/src/ffi.rs b/native/src/ffi.rs index 04cb17e..f16f3c8 100644 --- a/native/src/ffi.rs +++ b/native/src/ffi.rs @@ -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, accepted_key: Option, - history: Vec<(String, i64)>, + history: Vec, } 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(), })?) })