Add live updating of users

Provied a subscription for user updates and send updates whenever the
details of a user account is changed.
This commit is contained in:
Hornwitser committed 2022-07-08 01:00:54 +02:00
1 parent db562ce6a0
commit 096f338277
12 files changed
+292 -39

No files matched your search

+8
View File
@@ -28,6 +28,7 @@ class TestControl extends libLink.Link {
this.slaveUpdates = [];
this.instanceUpdates = [];
this.saveListUpdates = [];
this.userUpdates = [];
this.connector.on("connect", () => {
libLink.messages.setSlaveSubscriptions.send(
@@ -39,6 +40,9 @@ class TestControl extends libLink.Link {
libLink.messages.setSaveListSubscriptions.send(
this, { all: true, instance_ids: [] }
).catch(err => logger.error(`Error setting save list subscriptions:\n${err.stack}`));
libLink.messages.setUserSubscriptions.send(
this, { all: true, names: [] }
).catch(err => logger.error(`Error setting user subscriptions:\n${err.stack}`));
});
}
@@ -63,6 +67,10 @@ class TestControl extends libLink.Link {
this.saveListUpdates.push(message.data);
}
async userUpdateEventHandler(message) {
this.userUpdates.push(message.data);
}
async logMessageEventHandler() { }
}