refactor: Fix most errors in api/client/messages.rs

This commit is contained in:
Ginger
2026-04-28 09:16:52 -04:00
parent 496ca80393
commit bcff259875
+9 -7
View File
@@ -26,15 +26,17 @@ use ruma::{
DeviceId, RoomId, UserId, DeviceId, RoomId, UserId,
api::{ api::{
Direction, Direction,
client::{error::ErrorKind, filter::RoomEventFilter, message::get_message_events}, client::{filter::RoomEventFilter, message::get_message_events},
error::ErrorKind,
}, },
assign,
events::{ events::{
AnyStateEvent, StateEventType, AnyStateEvent, StateEventType,
TimelineEventType::{self, *}, TimelineEventType::{self, *},
invite_permission_config::FilterLevel,
}, },
serde::Raw, serde::Raw,
}; };
use ruminuwuity::invite_permission_config::FilterLevel;
use tracing::warn; use tracing::warn;
use crate::Ruma; use crate::Ruma;
@@ -199,12 +201,12 @@ pub(crate) async fn get_message_events_route(
.map(Event::into_format) .map(Event::into_format)
.collect(); .collect();
Ok(get_message_events::v3::Response { Ok(assign!(get_message_events::v3::Response::new(), {
start: from.to_string(), start: from.to_string(),
end: next_token.as_ref().map(PduCount::to_string), end: next_token.as_ref().map(PduCount::to_string),
chunk, chunk: chunk,
state, state: state,
}) }))
} }
pub(crate) async fn lazy_loading_witness<'a, I>( pub(crate) async fn lazy_loading_witness<'a, I>(
@@ -301,7 +303,7 @@ where
{ {
// exclude Synapse's dummy events from bloating up response bodies. clients // exclude Synapse's dummy events from bloating up response bodies. clients
// don't need to see this. // don't need to see this.
if event.kind().to_cow_str() == "org.matrix.dummy_event" { if event.kind().to_string() == "org.matrix.dummy_event" {
return Ok(true); return Ok(true);
} }