Private
Public Access
1
0

daemon: add support for getting messages from db

This commit is contained in:
2025-04-28 16:00:04 -07:00
parent 9c245a5b52
commit c189e5f9e3
11 changed files with 267 additions and 15 deletions

View File

@@ -86,6 +86,17 @@ impl From<kordophone_db::models::Message> for PrintableMessage {
}
}
impl From<arg::PropMap> for PrintableMessage {
fn from(value: arg::PropMap) -> Self {
Self {
guid: value.get("id").unwrap().as_str().unwrap().to_string(),
date: OffsetDateTime::from_unix_timestamp(value.get("date").unwrap().as_i64().unwrap()).unwrap(),
sender: value.get("sender").unwrap().as_str().unwrap().to_string(),
text: value.get("text").unwrap().as_str().unwrap().to_string(),
}
}
}
pub struct ConversationPrinter<'a> {
doc: RcDoc<'a, PrintableConversation>
}