mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-19 12:33:06 -06:00
- Fix error with matrix-synapse-register node
- Ensure matrix-server-config's register/deregister methods are always available
This commit is contained in:
parent
9661922f78
commit
c920dd12cb
@ -17,6 +17,7 @@ if (!globalThis.fetch) {
|
||||
}
|
||||
|
||||
module.exports = function(RED) {
|
||||
console.log(RED.settings.contextStorage);
|
||||
// disable logging if set to "off"
|
||||
let loggingSettings = RED.settings.get('logging');
|
||||
if(
|
||||
@ -57,6 +58,14 @@ module.exports = function(RED) {
|
||||
this.globalAccess = n.global;
|
||||
this.initializedAt = new Date();
|
||||
|
||||
// Keep track of all consumers of this node to be able to catch errors
|
||||
node.register = function(consumerNode) {
|
||||
node.users[consumerNode.id] = consumerNode;
|
||||
};
|
||||
node.deregister = function(consumerNode) {
|
||||
delete node.users[consumerNode.id];
|
||||
};
|
||||
|
||||
if(!this.userId) {
|
||||
node.log("Matrix connection failed: missing user ID in configuration.");
|
||||
return;
|
||||
@ -424,14 +433,6 @@ module.exports = function(RED) {
|
||||
}
|
||||
)
|
||||
})();
|
||||
|
||||
// Keep track of all consumers of this node to be able to catch errors
|
||||
node.register = function(consumerNode) {
|
||||
node.users[consumerNode.id] = consumerNode;
|
||||
};
|
||||
node.deregister = function(consumerNode) {
|
||||
delete node.users[consumerNode.id];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
|
||||
node.server.register(node);
|
||||
|
||||
node.on("input", async function (msg) {
|
||||
const { got } = await import('got');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user