Private
Public Access
1
0

daemon: adds conversation list limit, fixes auth saving in db auth store

This commit is contained in:
2025-05-03 18:19:48 -07:00
parent 26d54f91d5
commit 0d61b6f2d7
13 changed files with 69 additions and 37 deletions

View File

@@ -175,8 +175,8 @@ impl Daemon {
reply.send(()).unwrap();
},
Event::GetAllConversations(reply) => {
let conversations = self.get_conversations().await;
Event::GetAllConversations(limit, offset, reply) => {
let conversations = self.get_conversations_limit_offset(limit, offset).await;
reply.send(conversations).unwrap();
},
@@ -226,7 +226,11 @@ impl Daemon {
}
async fn get_conversations(&mut self) -> Vec<Conversation> {
self.database.lock().await.with_repository(|r| r.all_conversations().unwrap()).await
self.database.lock().await.with_repository(|r| r.all_conversations(i32::MAX, 0).unwrap()).await
}
async fn get_conversations_limit_offset(&mut self, limit: i32, offset: i32) -> Vec<Conversation> {
self.database.lock().await.with_repository(|r| r.all_conversations(limit, offset).unwrap()).await
}
async fn get_messages(&mut self, conversation_id: String, last_message_id: Option<String>) -> Vec<Message> {