chore: replace old comments

This commit is contained in:
naskya 2024-05-05 21:22:57 +09:00
parent 9a4a75bf92
commit 359fef0a42
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 29 additions and 21 deletions

View file

@ -214,19 +214,26 @@ export function stringToAcct(acct: string): Acct
export function acctToString(acct: Acct): string export function acctToString(acct: Acct): string
export function addNoteToAntenna(antennaId: string, note: Note): void export function addNoteToAntenna(antennaId: string, note: Note): void
/** /**
* @param host punycoded instance host * Checks if a server is blocked.
* @returns whether the given host should be blocked *
*/ * ## Argument
* `host` - punycoded instance host
*/
export function isBlockedServer(host: string): Promise<boolean> export function isBlockedServer(host: string): Promise<boolean>
/** /**
* @param host punycoded instance host * Checks if a server is silenced.
* @returns whether the given host should be limited *
*/ * ## Argument
* `host` - punycoded instance host
*/
export function isSilencedServer(host: string): Promise<boolean> export function isSilencedServer(host: string): Promise<boolean>
/** /**
* @param host punycoded instance host * Checks if a server is allowlisted.
* @returns whether the given host is allowlisted (this is always true if private mode is disabled) * Returns `Ok(true)` if private mode is disabled.
*/ *
* ## Argument
* `host` - punycoded instance host
*/
export function isAllowedServer(host: string): Promise<boolean> export function isAllowedServer(host: string): Promise<boolean>
/** TODO: handle name collisions better */ /** TODO: handle name collisions better */
export interface NoteLikeForCheckWordMute { export interface NoteLikeForCheckWordMute {

View file

@ -1,10 +1,10 @@
use crate::misc::meta::fetch_meta; use crate::misc::meta::fetch_meta;
use sea_orm::DbErr; use sea_orm::DbErr;
/** /// Checks if a server is blocked.
* @param host punycoded instance host ///
* @returns whether the given host should be blocked /// ## Argument
*/ /// `host` - punycoded instance host
#[crate::export] #[crate::export]
pub async fn is_blocked_server(host: &str) -> Result<bool, DbErr> { pub async fn is_blocked_server(host: &str) -> Result<bool, DbErr> {
Ok(fetch_meta(true) Ok(fetch_meta(true)
@ -16,10 +16,10 @@ pub async fn is_blocked_server(host: &str) -> Result<bool, DbErr> {
})) }))
} }
/** /// Checks if a server is silenced.
* @param host punycoded instance host ///
* @returns whether the given host should be limited /// ## Argument
*/ /// `host` - punycoded instance host
#[crate::export] #[crate::export]
pub async fn is_silenced_server(host: &str) -> Result<bool, DbErr> { pub async fn is_silenced_server(host: &str) -> Result<bool, DbErr> {
Ok(fetch_meta(true) Ok(fetch_meta(true)
@ -31,10 +31,11 @@ pub async fn is_silenced_server(host: &str) -> Result<bool, DbErr> {
})) }))
} }
/** /// Checks if a server is allowlisted.
* @param host punycoded instance host /// Returns `Ok(true)` if private mode is disabled.
* @returns whether the given host is allowlisted (this is always true if private mode is disabled) ///
*/ /// ## Argument
/// `host` - punycoded instance host
#[crate::export] #[crate::export]
pub async fn is_allowed_server(host: &str) -> Result<bool, DbErr> { pub async fn is_allowed_server(host: &str) -> Result<bool, DbErr> {
let meta = fetch_meta(true).await?; let meta = fetch_meta(true).await?;