Membership refactor

Introduce deactivate, membership services

Move membership and user deactivation functions from api crate into those services
This commit is contained in:
dasha_uwu committed 2025-08-28 23:28:20 +05:00
1 parent 6810604629
commit 8e9c6661b2
28 files changed
+2317 -2090

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
use ruma::{RoomId, UserId};
use tuwunel_core::{Err, Result, warn};
use tuwunel_service::Services;
pub(crate) async fn invite_check(
services: &Services,
sender_user: &UserId,
room_id: &RoomId,
) -> Result {
if !services.users.is_admin(sender_user).await && services.config.block_non_admin_invites {
warn!("{sender_user} is not an admin and attempted to send an invite to {room_id}");
return Err!(Request(Forbidden("Invites are not allowed on this server.")));
}
Ok(())
}