Compare commits
14 commits
Author | SHA1 | Date | |
---|---|---|---|
e283dd3438 | |||
7e07d246df | |||
fbd8780600 | |||
73ef497609 | |||
6e105a8a41 | |||
5443768b5c | |||
0328932c54 | |||
048dfef76c | |||
36dbf8ce89 | |||
7a0ae6c09a | |||
fc8d8df801 | |||
e972ef6891 | |||
9b42845e0b | |||
0a08025728 |
6 changed files with 1029 additions and 658 deletions
|
@ -141,7 +141,7 @@ pub async fn get_message_events_route(
|
|||
.lazy_load_confirm_delivery(sender_user, sender_device, &body.room_id, from)
|
||||
.await?;
|
||||
|
||||
let limit = u64::from(body.limit).min(100) as usize;
|
||||
let limit = u64::from(body.limit).min(2000) as usize;
|
||||
|
||||
let next_token;
|
||||
|
||||
|
|
|
@ -75,4 +75,28 @@ impl service::rooms::alias::Data for KeyValueDatabase {
|
|||
})
|
||||
.transpose()
|
||||
}
|
||||
|
||||
fn all_local_aliases<'a>(
|
||||
&'a self,
|
||||
) -> Box<dyn Iterator<Item = Result<(OwnedRoomId, String)>> + 'a> {
|
||||
Box::new(
|
||||
self.alias_roomid
|
||||
.iter()
|
||||
.map(|(room_alias_bytes, room_id_bytes)| {
|
||||
let room_alias_localpart = utils::string_from_bytes(&room_alias_bytes)
|
||||
.map_err(|_| {
|
||||
Error::bad_database("Invalid alias bytes in aliasid_alias.")
|
||||
})?;
|
||||
|
||||
let room_id = utils::string_from_bytes(&room_id_bytes)
|
||||
.map_err(|_| {
|
||||
Error::bad_database("Invalid room_id bytes in aliasid_alias.")
|
||||
})?
|
||||
.try_into()
|
||||
.map_err(|_| Error::bad_database("Invalid room_id in aliasid_alias."))?;
|
||||
|
||||
Ok((room_id, room_alias_localpart))
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,4 +19,9 @@ pub trait Data: Send + Sync {
|
|||
&'a self,
|
||||
room_id: &RoomId,
|
||||
) -> Box<dyn Iterator<Item = Result<OwnedRoomAliasId>> + 'a>;
|
||||
|
||||
/// Returns all local aliases on the server
|
||||
fn all_local_aliases<'a>(
|
||||
&'a self,
|
||||
) -> Box<dyn Iterator<Item = Result<(OwnedRoomId, String)>> + 'a>;
|
||||
}
|
||||
|
|
|
@ -98,4 +98,11 @@ impl Service {
|
|||
) -> Box<dyn Iterator<Item = Result<OwnedRoomAliasId>> + 'a> {
|
||||
self.db.local_aliases_for_room(room_id)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub fn all_local_aliases<'a>(
|
||||
&'a self,
|
||||
) -> Box<dyn Iterator<Item = Result<(OwnedRoomId, String)>> + 'a> {
|
||||
self.db.all_local_aliases()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -506,7 +506,11 @@ impl Service {
|
|||
.state_cache
|
||||
.is_joined(server_user, &admin_room)?
|
||||
{
|
||||
services().admin.process_message(body);
|
||||
services().admin.process_message(
|
||||
body,
|
||||
pdu.event_id.clone(),
|
||||
pdu.sender.clone(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1187,7 +1191,7 @@ impl Service {
|
|||
federation::backfill::get_backfill::v1::Request {
|
||||
room_id: room_id.to_owned(),
|
||||
v: vec![first_pdu.1.event_id.as_ref().to_owned()],
|
||||
limit: uint!(100),
|
||||
limit: uint!(1000),
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
|
Loading…
Reference in a new issue