Add control reference to web plugins

Add reference to the Control instance in BaseWebPlugin for web plugin
code to use in a similar manner to the instance reference in instance
plugin code.
This commit is contained in:
Hornwitser committed 2021-03-20 03:35:05 +01:00
1 parent 0a6e26bb2d
commit 6c19145734
2 files changed
+8

No files matched your search

+7
View File
@@ -514,6 +514,13 @@ class BaseWebPlugin {
*/
this.info = info;
/**
* Control link to the master server, not available until the
* connect event in onMasterConnectionEvent is signaled.
* @type {?module:lib/link.Link}
*/
this.control = null;
/**
* Logger for this plugin
*
+1
View File
@@ -46,6 +46,7 @@ export class Control extends libLink.Link {
*/
this.plugins = plugins;
for (let plugin of plugins.values()) {
plugin.control = this;
libPlugin.attachPluginMessages(this, plugin);
}