mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 21:52:30 -04:00
bindings: Add ignore_user
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user