Skip to content

Commit 1a78b77

Browse files
richvdhpoljar
andauthored
doc: Improve the documentation of "tracked users"
I had no idea what a tracked user was, so I've attempted to clarify this somewhat for future readers. Co-authored-by: Damir Jelić <poljar@termina.org.uk>
1 parent d5cebc3 commit 1a78b77

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/machine.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ impl OlmMachine {
161161
future_to_promise(async move { Ok(me.display_name().await?) })
162162
}
163163

164-
/// Get all the tracked users of our own device.
164+
/// Get the list of users whose devices we are currently tracking.
165+
///
166+
/// A user can be marked for tracking using the
167+
/// [`update_tracked_users`](#method.update_tracked_users) method.
165168
///
166169
/// Returns a `Set<UserId>`.
167170
#[wasm_bindgen(js_name = "trackedUsers")]
@@ -175,16 +178,23 @@ impl OlmMachine {
175178
set
176179
}
177180

178-
/// Update the tracked users.
181+
/// Update the list of tracked users.
182+
///
183+
/// The OlmMachine maintains a list of users whose devices we are keeping
184+
/// track of: these are known as "tracked users". These must be users
185+
/// that we share a room with, so that the server sends us updates for
186+
/// their device lists.
187+
///
188+
/// # Arguments
179189
///
180-
/// `users` is an iterator over user IDs that should be marked for
181-
/// tracking.
190+
/// * `users` - An array of user ids that should be added to the list of
191+
/// tracked users
182192
///
183-
/// This will mark users that weren't seen before for a key query
184-
/// and tracking.
193+
/// Any users that hadn't been seen before will be flagged for a key query
194+
/// immediately, and whenever `receive_sync_changes` receives a
195+
/// "changed" notification for that user in the future.
185196
///
186-
/// If the user is already known to the Olm machine, it will not
187-
/// be considered for a key query.
197+
/// Users that were already in the list are unaffected.
188198
#[wasm_bindgen(js_name = "updateTrackedUsers")]
189199
pub fn update_tracked_users(&self, users: &Array) -> Result<Promise, JsError> {
190200
let users = users

0 commit comments

Comments
 (0)