diff --git a/packages/jupyterlab-collaborative-chat/src/ychat.ts b/packages/jupyterlab-collaborative-chat/src/ychat.ts index 1ae101d7..3b7e2a4f 100644 --- a/packages/jupyterlab-collaborative-chat/src/ychat.ts +++ b/packages/jupyterlab-collaborative-chat/src/ychat.ts @@ -137,6 +137,16 @@ export class YChat extends YDocument { }); } + getMetadata(key: string): IMetadata | undefined { + return this._metadata.get(key); + } + + setMetadata(key: string, value: PartialJSONValue) { + this.transact(() => { + this._metadata.set(key, value); + }); + } + private _usersObserver = (event: Y.YMapEvent): void => { const userChange = new Array(); event.keysChanged.forEach(key => { diff --git a/python/jupyterlab-collaborative-chat/jupyterlab_collaborative_chat/ychat.py b/python/jupyterlab-collaborative-chat/jupyterlab_collaborative_chat/ychat.py index b3cdc172..2d60f09f 100644 --- a/python/jupyterlab-collaborative-chat/jupyterlab_collaborative_chat/ychat.py +++ b/python/jupyterlab-collaborative-chat/jupyterlab_collaborative_chat/ychat.py @@ -149,7 +149,7 @@ def get_metadata(self) -> dict[str, dict]: """ return self._ymetadata.to_py() - def set_metadata(self, name: str, metadata: dict): + def set_metadata(self, name: str, metadata: Any): """ Adds or modifies a metadata of the document. """