obscura-server 0.6.2

A server for relaying secure messages using the Signal Protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::domain::message::Message;
use time::OffsetDateTime;
use uuid::Uuid;

#[derive(Debug, sqlx::FromRow)]
pub struct MessageRecord {
    pub(crate) id: Uuid,
    pub(crate) sender_id: Uuid,
    pub(crate) content: Vec<u8>,
    pub(crate) created_at: Option<OffsetDateTime>,
}

impl From<MessageRecord> for Message {
    fn from(record: MessageRecord) -> Self {
        Self { id: record.id, sender_id: record.sender_id, content: record.content, created_at: record.created_at }
    }
}