Skip to main content

tuwunel_admin/query/sync/
drop_connections.rs

1use ruma::{OwnedDeviceId, OwnedUserId};
2use tuwunel_core::Result;
3
4use crate::admin_command;
5
6#[admin_command]
7pub(super) async fn drop_connections(
8	&self,
9	user_id: Option<OwnedUserId>,
10	device_id: Option<OwnedDeviceId>,
11	conn_id: Option<String>,
12) -> Result {
13	self.services
14		.sync
15		.clear_connections(
16			user_id.as_deref(),
17			device_id.as_deref(),
18			conn_id.map(Into::into).as_ref(),
19		)
20		.await;
21
22	Ok(())
23}