pub struct OutboundDmStore {
pub entries: Vec<OutboundDmEntry>,
pub hidden_threads: Vec<HiddenDmThreadEntry>,
}Expand description
Persistent cache of outbound DM plaintext, keyed by
(room_owner_vk, recipient, purge_token) inside each entry.
Stored as a Vec rather than HashMap so JSON serialization works
— see the “non-string map keys” bug-prevention pattern in
freenet/.claude/rules/bug-prevention-patterns.md. Lookups are
linear, which is fine: the store is bounded by per-pair caps
(MAX_DM_MESSAGES_PER_PAIR) and pruned on purge tombstones.
Piggybacks the hidden_threads list (issue freenet/river#261) — a
purely local “hide this DM thread from my left rail until a fresh
message arrives” view filter. We pack it into the same delegate
blob so a single chat-delegate fetch hydrates both, and so a hide
on device A is visible on device B without a second storage key.
Fields§
§entries: Vec<OutboundDmEntry>Per-(room, peer) “hidden-at” cutoff timestamps. Filter rule:
a thread is hidden iff hidden_at_ts >= max(message.timestamp)
for messages between the local user and peer in that room.
#[serde(default)] so pre-#261 wire bytes (a Vec<entries>-only
OutboundDmStore) keep decoding into an empty hidden_threads.
Trait Implementations§
Source§impl Clone for OutboundDmStore
impl Clone for OutboundDmStore
Source§fn clone(&self) -> OutboundDmStore
fn clone(&self) -> OutboundDmStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OutboundDmStore
impl Debug for OutboundDmStore
Source§impl Default for OutboundDmStore
impl Default for OutboundDmStore
Source§fn default() -> OutboundDmStore
fn default() -> OutboundDmStore
Source§impl<'de> Deserialize<'de> for OutboundDmStore
impl<'de> Deserialize<'de> for OutboundDmStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OutboundDmStore
impl PartialEq for OutboundDmStore
Source§fn eq(&self, other: &OutboundDmStore) -> bool
fn eq(&self, other: &OutboundDmStore) -> bool
self and other values to be equal, and is used by ==.