mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-20 13:03:12 -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) {
|
module.exports = function(RED) {
|
||||||
|
console.log(RED.settings.contextStorage);
|
||||||
// disable logging if set to "off"
|
// disable logging if set to "off"
|
||||||
let loggingSettings = RED.settings.get('logging');
|
let loggingSettings = RED.settings.get('logging');
|
||||||
if(
|
if(
|
||||||
@ -57,6 +58,14 @@ module.exports = function(RED) {
|
|||||||
this.globalAccess = n.global;
|
this.globalAccess = n.global;
|
||||||
this.initializedAt = new Date();
|
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) {
|
if(!this.userId) {
|
||||||
node.log("Matrix connection failed: missing user ID in configuration.");
|
node.log("Matrix connection failed: missing user ID in configuration.");
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
node.server.register(node);
|
|
||||||
|
|
||||||
node.on("input", async function (msg) {
|
node.on("input", async function (msg) {
|
||||||
const { got } = await import('got');
|
const { got } = await import('got');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user