From 1c4011325fd36b9b9e9e20c201fb0dc3d161b4bb Mon Sep 17 00:00:00 2001 From: randogoth Date: Tue, 29 Sep 2026 11:08:05 +0300 Subject: [PATCH] feat: read a contact's acceptance state --- core/src/store.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/src/store.rs b/core/src/store.rs index 1b09873..20c25d1 100644 --- a/core/src/store.rs +++ b/core/src/store.rs @@ -453,6 +453,17 @@ impl Store { Ok(changed > 0) } + /// The acceptance state of an address, if it was ever accepted: + /// Some(true) main tier, Some(false) blocked, None never. + pub fn accepted_state(&self, address: &str) -> Result, Error> { + Ok(self + .one::( + "SELECT active FROM accepted WHERE address = ?1", + &[&address], + )? + .map(|active| active != 0)) + } + /// The identity frozen at acceptance, if this address is currently /// accepted; the token for our own mailbox travels in the next message. pub fn accepted_identity(&self, address: &str) -> Result, Error> {