Private
Public Access
1
0

kpcli: db: add support for printing messages table

This commit is contained in:
2025-01-20 22:23:18 -08:00
parent bfc6fdddc1
commit 16c202734c
2 changed files with 45 additions and 1 deletions

View File

@@ -55,6 +55,17 @@ impl From<kordophone::model::Message> for PrintableMessage {
}
}
impl From<kordophone_db::models::Message> for PrintableMessage {
fn from(value: kordophone_db::models::Message) -> Self {
Self {
guid: value.id,
date: OffsetDateTime::from_unix_timestamp(value.date.and_utc().timestamp()).unwrap(),
sender: value.sender.display_name(),
text: value.text,
}
}
}
pub struct ConversationPrinter<'a> {
doc: RcDoc<'a, PrintableConversation>
}