fix: Apply client-requested timeout to federated key queries
Also parallelised federation calls in related functions
This commit is contained in:
parent
6c61b3ec5b
commit
bc426e1bfc
7 changed files with 81 additions and 33 deletions
|
|
@ -188,7 +188,7 @@ pub async fn revoke_admin(&self, user_id: &UserId) -> Result {
|
|||
warn!(
|
||||
"Revoking the admin status of {user_id} will not work correctly as they are within \
|
||||
the admins_list config."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
let Ok(room_id) = self.get_admin_room().await else {
|
||||
|
|
|
|||
|
|
@ -406,13 +406,20 @@ impl Service {
|
|||
|
||||
/// Checks whether a given user is an admin of this server
|
||||
pub async fn user_is_admin(&self, user_id: &UserId) -> bool {
|
||||
if self.services.server.config.admins_list.contains(&user_id.to_owned()) {
|
||||
if self
|
||||
.services
|
||||
.server
|
||||
.config
|
||||
.admins_list
|
||||
.contains(&user_id.to_owned())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if self.services.server.config.admins_from_room {
|
||||
if let Ok(admin_room) = self.get_admin_room().await {
|
||||
return self.services
|
||||
return self
|
||||
.services
|
||||
.state_cache
|
||||
.is_joined(user_id, &admin_room)
|
||||
.await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue