make everything pub(crate) instead of pub

conduwuit is not a library

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-22 23:48:57 -04:00 committed by June
parent 472c32f453
commit 66bb88a03a
135 changed files with 1366 additions and 1247 deletions

View file

@ -2,7 +2,7 @@ use ruma::{api::appservice::Registration, events::room::message::RoomMessageEven
use crate::{service::admin::escape_html, services, Result};
pub(super) async fn register(body: Vec<&str>) -> Result<RoomMessageEventContent> {
pub(crate) async fn register(body: Vec<&str>) -> Result<RoomMessageEventContent> {
if body.len() > 2 && body[0].trim().starts_with("```") && body.last().unwrap().trim() == "```" {
let appservice_config = body[1..body.len() - 1].join("\n");
let parsed_config = serde_yaml::from_str::<Registration>(&appservice_config);
@ -26,7 +26,7 @@ pub(super) async fn register(body: Vec<&str>) -> Result<RoomMessageEventContent>
}
}
pub(super) async fn unregister(_body: Vec<&str>, appservice_identifier: String) -> Result<RoomMessageEventContent> {
pub(crate) async fn unregister(_body: Vec<&str>, appservice_identifier: String) -> Result<RoomMessageEventContent> {
match services()
.appservice
.unregister_appservice(&appservice_identifier)
@ -39,7 +39,7 @@ pub(super) async fn unregister(_body: Vec<&str>, appservice_identifier: String)
}
}
pub(super) async fn show(_body: Vec<&str>, appservice_identifier: String) -> Result<RoomMessageEventContent> {
pub(crate) async fn show(_body: Vec<&str>, appservice_identifier: String) -> Result<RoomMessageEventContent> {
match services()
.appservice
.get_registration(&appservice_identifier)
@ -59,7 +59,7 @@ pub(super) async fn show(_body: Vec<&str>, appservice_identifier: String) -> Res
}
}
pub(super) async fn list(_body: Vec<&str>) -> Result<RoomMessageEventContent> {
pub(crate) async fn list(_body: Vec<&str>) -> Result<RoomMessageEventContent> {
let appservices = services().appservice.iter_ids().await;
let output = format!("Appservices ({}): {}", appservices.len(), appservices.join(", "));
Ok(RoomMessageEventContent::text_plain(output))