diff --git a/packages/backend-rs/index.d.ts b/packages/backend-rs/index.d.ts index 4f14e02b6c..0a92da8596 100644 --- a/packages/backend-rs/index.d.ts +++ b/packages/backend-rs/index.d.ts @@ -214,19 +214,26 @@ export function stringToAcct(acct: string): Acct export function acctToString(acct: Acct): string export function addNoteToAntenna(antennaId: string, note: Note): void /** - * @param host punycoded instance host - * @returns whether the given host should be blocked -*/ + * Checks if a server is blocked. + * + * ## Argument + * `host` - punycoded instance host + */ export function isBlockedServer(host: string): Promise /** - * @param host punycoded instance host - * @returns whether the given host should be limited -*/ + * Checks if a server is silenced. + * + * ## Argument + * `host` - punycoded instance host + */ export function isSilencedServer(host: string): Promise /** - * @param host punycoded instance host - * @returns whether the given host is allowlisted (this is always true if private mode is disabled) -*/ + * Checks if a server is allowlisted. + * Returns `Ok(true)` if private mode is disabled. + * + * ## Argument + * `host` - punycoded instance host + */ export function isAllowedServer(host: string): Promise /** TODO: handle name collisions better */ export interface NoteLikeForCheckWordMute { diff --git a/packages/backend-rs/src/misc/check_server_block.rs b/packages/backend-rs/src/misc/check_server_block.rs index b5e262aa87..bb7f40078a 100644 --- a/packages/backend-rs/src/misc/check_server_block.rs +++ b/packages/backend-rs/src/misc/check_server_block.rs @@ -1,10 +1,10 @@ use crate::misc::meta::fetch_meta; use sea_orm::DbErr; -/** - * @param host punycoded instance host - * @returns whether the given host should be blocked - */ +/// Checks if a server is blocked. +/// +/// ## Argument +/// `host` - punycoded instance host #[crate::export] pub async fn is_blocked_server(host: &str) -> Result { Ok(fetch_meta(true) @@ -16,10 +16,10 @@ pub async fn is_blocked_server(host: &str) -> Result { })) } -/** - * @param host punycoded instance host - * @returns whether the given host should be limited - */ +/// Checks if a server is silenced. +/// +/// ## Argument +/// `host` - punycoded instance host #[crate::export] pub async fn is_silenced_server(host: &str) -> Result { Ok(fetch_meta(true) @@ -31,10 +31,11 @@ pub async fn is_silenced_server(host: &str) -> Result { })) } -/** - * @param host punycoded instance host - * @returns whether the given host is allowlisted (this is always true if private mode is disabled) - */ +/// Checks if a server is allowlisted. +/// Returns `Ok(true)` if private mode is disabled. +/// +/// ## Argument +/// `host` - punycoded instance host #[crate::export] pub async fn is_allowed_server(host: &str) -> Result { let meta = fetch_meta(true).await?;