mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-08-18 10:12:38 +00:00
Impl /room
and /room/{ruuid}/admin
endpoints
This commit is contained in:
parent
e84b13c876
commit
5d15900436
5 changed files with 245 additions and 29 deletions
11
src/types.rs
11
src/types.rs
|
@ -337,6 +337,14 @@ pub enum RoomAdminPayload {
|
|||
// TODO: CRUD
|
||||
}
|
||||
|
||||
impl RoomAdminPayload {
|
||||
pub fn room(&self) -> &Uuid {
|
||||
match self {
|
||||
RoomAdminPayload::AddMember { room, .. } => room,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct ServerPermission: u64 {
|
||||
|
@ -350,12 +358,15 @@ bitflags! {
|
|||
const POST_CHAT = 1 << 0;
|
||||
const ADD_MEMBER = 1 << 1;
|
||||
|
||||
const MAX_SELF_ADD = Self::POST_CHAT.bits();
|
||||
|
||||
const ALL = !0;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub struct RoomAttrs: u64 {
|
||||
const PUBLIC_READABLE = 1 << 0;
|
||||
const PUBLIC_JOINABLE = 1 << 1;
|
||||
|
||||
const _ = !0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue