|
|
|
|
@ -12,6 +12,7 @@ use tracing::warn;
@@ -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 {
@@ -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(); |
|
|
|
|
|