Skip to content

Commit a33d2ad

Browse files
authored
bindings: Add ignore_user
1 parent 6b5f0b8 commit a33d2ad

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

bindings/matrix-sdk-ffi/src/api.udl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ interface Room {
256256

257257
[Throws=ClientError]
258258
void report_content(string event_id, i32? score, string? reason);
259+
260+
[Throws=ClientError]
261+
void ignore_user(string user_id);
259262

260263
[Throws=ClientError]
261264
void send_reaction(string event_id, string key);

bindings/matrix-sdk-ffi/src/room.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,19 @@ impl Room {
446446
})
447447
}
448448

449+
/// Ignores a user.
450+
///
451+
/// # Arguments
452+
///
453+
/// * `event_id` - The ID of the user to ignore.
454+
pub fn ignore_user(&self, user_id: String) -> Result<()> {
455+
RUNTIME.block_on(async move {
456+
let user_id = UserId::parse(user_id)?;
457+
self.client().account().ignore_user(&user_id).await?;
458+
Ok(())
459+
})
460+
}
461+
449462
/// Leaves the joined room.
450463
///
451464
/// Will throw an error if used on an room that isn't in a joined state

0 commit comments

Comments
 (0)