pub struct MessageSummary {
pub id: MessageId,
pub sender_id: AgentId,
pub sender_name: String,
pub recipient_id: Option<AgentId>,
pub encryption: MessageEncryption,
pub body: Option<String>,
pub sent_at: DateTime<Utc>,
pub read_at: Option<DateTime<Utc>>,
pub ciphertext: Option<String>,
pub wrapped_key: Option<String>,
pub sender_public_key: Option<String>,
}Expand description
One message as rendered in an inbox.
recipient_id is None for broadcasts. body is None when the
server cannot produce plaintext (E2EE rows, phase 2) — clients
decrypt those locally from the ciphertext fields that phase 2 adds.
Fields§
§id: MessageId§sender_id: AgentId§sender_name: String§recipient_id: Option<AgentId>None = system broadcast (delivered to every agent).
encryption: MessageEncryption§body: Option<String>Plaintext body (server-mode and broadcasts). None for E2EE.
sent_at: DateTime<Utc>§read_at: Option<DateTime<Utc>>When this agent read the message. None = unread.
ciphertext: Option<String>E2EE only: hex envelope blob (version || xnonce || ct).
wrapped_key: Option<String>E2EE only: hex message key wrapped to this agent’s X25519 key (the recipient wrap for inbox rows, the sender wrap for outbox export).
sender_public_key: Option<String>E2EE only: the sender’s hex Ed25519 public key, for verifying the embedded message signature. TOFU: pin it — a key change for a known sender is a red flag, not a routine event.
Implementations§
Source§impl MessageSummary
impl MessageSummary
Sourcepub fn decrypt(
&self,
own_secret: &EncryptionSecretKey,
) -> Option<Result<String, EnvelopeError>>
pub fn decrypt( &self, own_secret: &EncryptionSecretKey, ) -> Option<Result<String, EnvelopeError>>
Decrypt and verify an E2EE message with this agent’s encryption
secret. Returns the plaintext, or None if this is not an E2EE
row (use body directly).
Verification uses the row’s own context fields and
sender_public_key — callers doing TOFU pinning should check
the key against their pin first.
Trait Implementations§
Source§impl Clone for MessageSummary
impl Clone for MessageSummary
Source§fn clone(&self) -> MessageSummary
fn clone(&self) -> MessageSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more