Add ability to remove an appservice
This commit is contained in:
parent
9b57c89df6
commit
7857da8a0b
4 changed files with 30 additions and 0 deletions
|
@ -12,6 +12,7 @@ use tracing::warn;
|
|||
|
||||
pub enum AdminCommand {
|
||||
RegisterAppservice(serde_yaml::Value),
|
||||
UnregisterAppservice(String),
|
||||
ListAppservices,
|
||||
SendMessage(RoomMessageEventContent),
|
||||
}
|
||||
|
@ -96,6 +97,9 @@ impl Admin {
|
|||
AdminCommand::RegisterAppservice(yaml) => {
|
||||
guard.appservice.register_appservice(yaml).unwrap(); // TODO handle error
|
||||
}
|
||||
AdminCommand::UnregisterAppservice(service_name) => {
|
||||
guard.appservice.unregister_appservice(&service_name).unwrap(); // TODO: see above
|
||||
}
|
||||
AdminCommand::ListAppservices => {
|
||||
if let Ok(appservices) = guard.appservice.iter_ids().map(|ids| ids.collect::<Vec<_>>()) {
|
||||
let count = appservices.len();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue