mirror of
https://github.com/element-hq/element-android
synced 2024-12-21 16:55:06 +03:00
rust: Expose a method to check if a user is tracked
This commit is contained in:
parent
87339fb0ee
commit
ac153c80d5
2 changed files with 11 additions and 0 deletions
|
@ -387,6 +387,15 @@ impl OlmMachine {
|
|||
.block_on(self.inner.update_tracked_users(users.iter()));
|
||||
}
|
||||
|
||||
/// Check if the given user is considered to be tracked.
|
||||
///
|
||||
/// A user can be marked for tracking using the
|
||||
/// [`OlmMachine::update_tracked_users()`] method.
|
||||
pub fn is_user_tracked(&self, user_id: &str) -> Result<bool, CryptoStoreError> {
|
||||
let user_id = UserId::try_from(user_id)?;
|
||||
Ok(self.inner.tracked_users().contains(&user_id))
|
||||
}
|
||||
|
||||
/// Generate one-time key claiming requests for all the users we are missing
|
||||
/// sessions for.
|
||||
///
|
||||
|
|
|
@ -271,6 +271,8 @@ interface OlmMachine {
|
|||
[Throws=CryptoStoreError]
|
||||
sequence<Device> get_user_devices([ByRef] string user_id);
|
||||
|
||||
[Throws=CryptoStoreError]
|
||||
boolean is_user_tracked([ByRef] string user_id);
|
||||
void update_tracked_users(sequence<string> users);
|
||||
[Throws=CryptoStoreError]
|
||||
Request? get_missing_sessions(sequence<string> users);
|
||||
|
|
Loading…
Reference in a new issue