feat(java): workspace user list

This commit is contained in:
zaaarf 2024-09-25 17:36:20 +02:00
parent 7d3a7ebef5
commit a756b2805c
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B
2 changed files with 16 additions and 0 deletions

View file

@ -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;
/**

View file

@ -31,6 +31,12 @@ fn active_buffers(workspace: &mut Workspace) -> Vec<String> {
workspace.buffer_list()
}
/// Gets a list of the active buffers.
#[jni(package = "mp.code", class = "Workspace")]
fn user_list(workspace: &mut Workspace) -> Vec<String> {
workspace.user_list()
}
/// Create a new buffer.
#[jni(package = "mp.code", class = "Workspace")]
fn create_buffer(workspace: &mut Workspace, path: String) -> Result<(), RemoteError> {