mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
unfinished untested impl of room deletion
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use std::mem;
|
||||
|
||||
use ruma::{api::client::threads::get_threads::v1::IncludeThreads, OwnedUserId, RoomId, UserId};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::{database::KeyValueDatabase, service, services, utils, Error, PduEvent, Result};
|
||||
|
||||
@@ -47,6 +48,18 @@ impl service::rooms::threads::Data for KeyValueDatabase {
|
||||
))
|
||||
}
|
||||
|
||||
fn delete_all_rooms_threads(&self, room_id: &RoomId) -> Result<()> {
|
||||
let mut prefix = room_id.as_bytes().to_vec();
|
||||
prefix.push(0xff);
|
||||
|
||||
for (key, _) in self.threadid_userids.scan_prefix(prefix) {
|
||||
debug!("Removing key: {:?}", key);
|
||||
self.threadid_userids.remove(&key)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn update_participants(&self, root_id: &[u8], participants: &[OwnedUserId]) -> Result<()> {
|
||||
let users = participants
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user