mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-16 05:36:50 +00:00
Split disable_room, ban_room functions
This commit is contained in:
1 parent
a4f589f475
commit
4884c55be7
3 files changed
+20
-34
No files matched your search
@@ -94,23 +94,19 @@ pub async fn is_public(&self, room_id: &RoomId) -> bool {
|
||||
|
||||
#[implement(Service)]
|
||||
#[inline]
|
||||
pub fn disable_room(&self, room_id: &RoomId, disabled: bool) {
|
||||
if disabled {
|
||||
self.db.disabledroomids.insert(room_id, []);
|
||||
} else {
|
||||
self.db.disabledroomids.remove(room_id);
|
||||
}
|
||||
}
|
||||
pub fn disable_room(&self, room_id: &RoomId) { self.db.disabledroomids.insert(room_id, []); }
|
||||
|
||||
#[implement(Service)]
|
||||
#[inline]
|
||||
pub fn ban_room(&self, room_id: &RoomId, banned: bool) {
|
||||
if banned {
|
||||
self.db.bannedroomids.insert(room_id, []);
|
||||
} else {
|
||||
self.db.bannedroomids.remove(room_id);
|
||||
}
|
||||
}
|
||||
pub fn enable_room(&self, room_id: &RoomId) { self.db.disabledroomids.remove(room_id); }
|
||||
|
||||
#[implement(Service)]
|
||||
#[inline]
|
||||
pub fn ban_room(&self, room_id: &RoomId) { self.db.bannedroomids.insert(room_id, []); }
|
||||
|
||||
#[implement(Service)]
|
||||
#[inline]
|
||||
pub fn unban_room(&self, room_id: &RoomId) { self.db.bannedroomids.remove(room_id); }
|
||||
|
||||
#[implement(Service)]
|
||||
pub fn list_banned_rooms(&self) -> impl Stream<Item = &RoomId> + Send + '_ {
|
||||
|
||||
Reference in new issue
Block a user