mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2026-05-18 13:13:18 -06:00
- matrix-receive node updated so that msg.sender is msg.userId instead (for better node chaining).
- change all references from msg.roomId to msg.topic to conform to Node-RED standards. - Added node for listing Synapse users server-wide (as long as the caller is an admin) - Events for Room.timeline are now handled by the server-config node and node's that listen for it bind a listener to that instead of the matrix client. - Added kick and ban nodes for kicking/banning from a room - Added node for fetching synapse user list using synapse admin API - Added node for fetching whois data from a user using Matrix admin API - Added node for deactivating users using the Synapse admin API - Can register users using the Synapse admin endpoint v1 (yay legacy) - Can add users using the Synapse admin endpoint v2 - Add more info to the readme.
This commit is contained in:
@@ -35,14 +35,14 @@ module.exports = function(RED) {
|
||||
node.send([null, msg]);
|
||||
}
|
||||
|
||||
msg.roomId = node.roomId || msg.roomId;
|
||||
if(!msg.roomId) {
|
||||
node.warn("Room must be specified in msg.roomId or in configuration");
|
||||
msg.topic = node.roomId || msg.topic;
|
||||
if(!msg.topic) {
|
||||
node.warn("Room must be specified in msg.topic or in configuration");
|
||||
return;
|
||||
}
|
||||
|
||||
if(msg.content) {
|
||||
node.server.matrixClient.sendMessage(msg.roomId, msg.content)
|
||||
if(msg.content && msg.type === 'm.image') {
|
||||
node.server.matrixClient.sendMessage(msg.topic, msg.content)
|
||||
.then(function(e) {
|
||||
node.log("Image message sent: " + e);
|
||||
msg.eventId = e.event_id;
|
||||
@@ -77,7 +77,7 @@ module.exports = function(RED) {
|
||||
})
|
||||
.then(function(file){
|
||||
node.server.matrixClient
|
||||
.sendImageMessage(msg.roomId, file.content_uri, {}, (msg.body || msg.filename) || "")
|
||||
.sendImageMessage(msg.topic, file.content_uri, {}, (msg.body || msg.filename) || "")
|
||||
.then(function(e) {
|
||||
node.log("Image message sent: " + e);
|
||||
msg.eventId = e.event_id;
|
||||
|
||||
Reference in New Issue
Block a user