bindings: Add ignore_user

This commit is contained in:
Doug
2023-03-30 09:59:19 +01:00
committed by GitHub
parent 6b5f0b8ec3
commit a33d2ad28f
2 changed files with 16 additions and 0 deletions

View File

@@ -256,6 +256,9 @@ interface Room {
[Throws=ClientError]
void report_content(string event_id, i32? score, string? reason);
[Throws=ClientError]
void ignore_user(string user_id);
[Throws=ClientError]
void send_reaction(string event_id, string key);

View File

@@ -446,6 +446,19 @@ impl Room {
})
}
/// Ignores a user.
///
/// # Arguments
///
/// * `event_id` - The ID of the user to ignore.
pub fn ignore_user(&self, user_id: String) -> Result<()> {
RUNTIME.block_on(async move {
let user_id = UserId::parse(user_id)?;
self.client().account().ignore_user(&user_id).await?;
Ok(())
})
}
/// Leaves the joined room.
///
/// Will throw an error if used on an room that isn't in a joined state