diff --git a/dist/java/src/mp/code/Workspace.java b/dist/java/src/mp/code/Workspace.java index 33f2de3..62a6e49 100644 --- a/dist/java/src/mp/code/Workspace.java +++ b/dist/java/src/mp/code/Workspace.java @@ -80,6 +80,16 @@ public final class Workspace { return active_buffers(this.ptr); } + private static native String[] user_list(long self); + + /** + * Returns the users currently in the workspace. + * @return an array containing the names of the users in the workspace + */ + public String[] userList() { + return user_list(this.ptr); + } + private static native void create_buffer(long self, String path) throws ConnectionRemoteException; /** diff --git a/src/ffi/java/workspace.rs b/src/ffi/java/workspace.rs index 06d8df4..5732397 100644 --- a/src/ffi/java/workspace.rs +++ b/src/ffi/java/workspace.rs @@ -31,6 +31,12 @@ fn active_buffers(workspace: &mut Workspace) -> Vec { workspace.buffer_list() } +/// Gets a list of the active buffers. +#[jni(package = "mp.code", class = "Workspace")] +fn user_list(workspace: &mut Workspace) -> Vec { + workspace.user_list() +} + /// Create a new buffer. #[jni(package = "mp.code", class = "Workspace")] fn create_buffer(workspace: &mut Workspace, path: String) -> Result<(), RemoteError> {