Plugin context

This commit is contained in:
2025-12-14 00:14:19 +01:00
parent 83e4a9f758
commit 51708ac050
3 changed files with 13 additions and 3 deletions
+5 -1
View File
@@ -9,9 +9,13 @@
"args"
],
"properties": {
"$schema": {
"type": "string",
"description": "Path or URL to the plugin schema"
},
"id": {
"type": "string",
"description": "Unique plugin identifier (recommended to be lowercase and use author/plugin format)",
"description": "Unique plugin identifier",
"minLength": 1
},
"version": {
+4 -1
View File
@@ -19,7 +19,10 @@ pub struct PluginHandshake {
#[derive(Debug, Clone, Serialize)]
#[serde(tag = "type", content = "params", rename_all = "snake_case")]
pub enum LoaderMessage {
Request(WsMessage<ClientMessage>),
Request {
user_id: String,
msg: WsMessage<ClientMessage>,
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
+4 -1
View File
@@ -179,7 +179,10 @@ impl Server {
let req = client.read()?;
if let Some(r) = &req {
for p in self.plugins.lock().unwrap().iter_mut() {
p.send(LoaderMessage::Request(r.clone()));
p.send(LoaderMessage::Request {
user_id: client.get_uuid().unwrap_or_default(),
msg: r.clone(),
});
}
self.wrap_err(&client, self.call_request(r, &client))?;