Private
Public Access
1
0

daemon: maintain outgoing message reference so model is consistent

This commit is contained in:
2025-05-03 21:45:53 -07:00
parent 0d61b6f2d7
commit d843127c6d
8 changed files with 124 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
use chrono::{DateTime, NaiveDateTime};
use uuid::Uuid;
use crate::models::participant::Participant;
use kordophone::model::outgoing_message::OutgoingMessage;
#[derive(Clone, Debug)]
pub struct Message {
@@ -40,6 +41,17 @@ impl From<kordophone::model::Message> for Message {
}
}
impl From<&OutgoingMessage> for Message {
fn from(value: &OutgoingMessage) -> Self {
Self {
id: value.guid.to_string(),
sender: Participant::Me,
text: value.text.clone(),
date: value.date,
}
}
}
pub struct MessageBuilder {
id: Option<String>,
sender: Option<Participant>,