refactor: Fix errors in api/client/threads.rs

This commit is contained in:
Ginger
2026-04-28 09:16:52 -04:00
parent e50e24e22d
commit 8d8c310a64
+7 -7
View File
@@ -7,7 +7,7 @@ use conduwuit::{
}, },
}; };
use futures::StreamExt; use futures::StreamExt;
use ruma::{api::client::threads::get_threads, uint}; use ruma::{api::client::threads::get_threads, assign, uint};
use crate::Ruma; use crate::Ruma;
@@ -59,18 +59,18 @@ pub(crate) async fn get_threads_route(
.collect() .collect()
.await; .await;
Ok(get_threads::v1::Response { let next_batch = threads
next_batch: threads
.last() .last()
.filter(|_| threads.len() >= limit) .filter(|_| threads.len() >= limit)
.map(at!(0)) .map(at!(0))
.as_ref() .as_ref()
.map(ToString::to_string), .map(ToString::to_string);
chunk: threads let chunk = threads
.into_iter() .into_iter()
.map(at!(1)) .map(at!(1))
.map(Event::into_format) .map(Event::into_format)
.collect(), .collect();
})
Ok(assign!(get_threads::v1::Response::new(chunk), { next_batch }))
} }