daemon: add support for getting messages from db
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user