diff options
| author | Jae-Heon Ji <32578710+jaeheonji@users.noreply.github.com> | 2022-01-03 23:54:41 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-03 15:54:41 +0100 |
| commit | 5dd3fce4a19d49889f0c3a24dab386403ca0e16f (patch) | |
| tree | acc5c1d250577f003aa9f61dc4208cdf59269962 | |
| parent | docs(changelog): ring bell (diff) | |
| download | sl0ppij-5dd3fce4a19d49889f0c3a24dab386403ca0e16f.tar.gz sl0ppij-5dd3fce4a19d49889f0c3a24dab386403ca0e16f.tar.xz sl0ppij-5dd3fce4a19d49889f0c3a24dab386403ca0e16f.zip | |
fix(plugins): register correct client id (#984)
| -rw-r--r-- | zellij-server/src/wasm_vm.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zellij-server/src/wasm_vm.rs b/zellij-server/src/wasm_vm.rs index db55e1c4..14865049 100644 --- a/zellij-server/src/wasm_vm.rs +++ b/zellij-server/src/wasm_vm.rs @@ -176,14 +176,16 @@ pub(crate) fn wasm_thread_main( } PluginInstruction::AddClient(client_id) => { connected_clients.push(client_id); + let mut seen = HashSet::new(); let mut new_plugins = HashMap::new(); - for (&(plugin_id, client_id), (instance, plugin_env)) in &plugin_map { + for (&(plugin_id, _), (instance, plugin_env)) in &plugin_map { if seen.contains(&plugin_id) { continue; } else { seen.insert(plugin_id); let mut new_plugin_env = plugin_env.clone(); + new_plugin_env.client_id = client_id; new_plugins.insert(plugin_id, (instance.module().clone(), new_plugin_env)); } |
