daemon: adds conversation list limit, fixes auth saving in db auth store
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user