Compare commits

...

14 commits

Author SHA1 Message Date
e283dd3438
Merge remote-tracking branch 'origin/better-admin-commands' into custom 2024-08-22 15:17:12 -07:00
7e07d246df
split out room info into its own function 2024-08-22 15:14:19 -07:00
fbd8780600
Make commands plural 2024-08-22 15:13:48 -07:00
73ef497609
ran cargo fmt 2024-08-22 15:13:38 -07:00
6e105a8a41
Fix table headers and pagination 2024-08-22 15:12:58 -07:00
5443768b5c
List pagination and html tables 2024-08-22 15:12:58 -07:00
0328932c54
Room directory admin commands 2024-08-22 15:12:57 -07:00
048dfef76c
reply to messages 2024-08-22 15:12:55 -07:00
36dbf8ce89
Admin room alias commands
- room alias set
- room alias remove
- room alias which
- room alias list
2024-08-22 15:01:56 -07:00
7a0ae6c09a
Add appservice show command to show config 2024-08-22 14:52:03 -07:00
fc8d8df801
Allow using languages in code blocks.
```yaml
This works now
```
2024-08-22 14:52:02 -07:00
e972ef6891
Rework admin commands to use subcommands.
This commit doesn't add, remove, or change any
commands, it only organizes them
2024-08-22 14:51:57 -07:00
9b42845e0b
increase backfill limit 2024-08-22 14:24:21 -07:00
0a08025728
increase message export length 2024-08-22 14:24:21 -07:00
6 changed files with 1029 additions and 658 deletions

View file

@ -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;

View file

@ -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

View file

@ -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>;
}

View file

@ -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()
}
}

View file

@ -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;