Private
Public Access
1
0

kpcli: adds support for querying messages

This commit is contained in:
2025-01-20 22:05:53 -08:00
parent 146fac2759
commit 5d3d2f194a
2 changed files with 3 additions and 3 deletions

View File

@@ -44,8 +44,8 @@ impl APIInterface for TestClient {
Ok(self.conversations.clone())
}
async fn get_messages(&mut self, conversation: Conversation) -> Result<Vec<Message>, Self::Error> {
if let Some(messages) = self.messages.get(&conversation.guid) {
async fn get_messages(&mut self, conversation_id: &ConversationID) -> Result<Vec<Message>, Self::Error> {
if let Some(messages) = self.messages.get(conversation_id) {
return Ok(messages.clone())
}

View File

@@ -31,7 +31,7 @@ impl From<kordophone_db::models::Conversation> for PrintableConversation {
date: OffsetDateTime::from_unix_timestamp(value.date.and_utc().timestamp()).unwrap(),
unread_count: value.unread_count.into(),
last_message_preview: value.last_message_preview,
participants: value.participants.into_iter().map(|p| p.display_name).collect(),
participants: value.participants.into_iter().map(|p| p.display_name()).collect(),
display_name: value.display_name,
}
}