Add connection events for control connections

Add hooks for plugins to be able to handle connection state changes for
control connections on the master server and in the web interface.
This commit is contained in:
Hornwitser committed 2021-03-20 03:35:05 +01:00
1 parent de629d9416
commit 0a6e26bb2d
3 files changed
+89

No files matched your search

+8
View File
@@ -73,6 +73,14 @@ export class Control extends libLink.Link {
this.connector.on("close", () => {
this.accountName = null;
});
for (let event of ["connect", "drop", "resume", "close"]) {
this.connector.on(event, () => {
for (let plugin of this.plugins.values()) {
plugin.onMasterConnectionEvent(event);
}
});
}
}
async logMessageEventHandler(message) {