mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix most errors in api/client/messages.rs
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user