- 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:
2021-08-18 11:18:29 -06:00
parent cd99955115
commit b33595d5eb
31 changed files with 1874 additions and 109 deletions
+75
View File
@@ -0,0 +1,75 @@
<script type="text/javascript">
RED.nodes.registerType('matrix-room-kick',{
category: 'matrix',
color: '#00b7ca',
icon: "matrix.png",
outputLabels: ["success", "error"],
inputs:1,
outputs:2,
defaults: {
name: { value: null },
server: { value: "", type: "matrix-server-config" },
roomId: { value: null }
},
label: function() {
return this.name || "Room Kick";
},
paletteLabel: 'Room Kick'
});
</script>
<script type="text/html" data-template-name="matrix-room-kick">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-server"><i class="fa fa-user"></i> Matrix Server Config</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-roomId"><i class="fa fa-user"></i> Room ID</label>
<input type="text" id="node-input-roomId" placeholder="msg.topic">
</div>
<div class="form-tips">
Room ID must either be defined here or passed in via <code>msg.topic</code>. The config takes precedence over the input.
</div>
</script>
<script type="text/html" data-help-name="matrix-room-kick">
<h3>Details</h3>
<p>This node will kick a user from a room as long as the bot has permission to do so.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>msg.userId
<span class="property-type">String</span>
</dt>
<dd> The ID of the user to kick.</dd>
<dt class="optional">msg.topic
<span class="property-type">String | Null</span>
</dt>
<dd> The room to kick the user from. Required if not defined on the config. Config takes precedence.</dd>
<dt class="optional">msg.reason
<span class="property-type">String</span>
</dt>
<dd> Reason for kicking the user.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Success
<dl class="message-properties">
<dd>original msg object preserved. Node doesn't set anything.</dd>
</dl>
</li>
<li>Error
<dl class="message-properties">
<dt>msg.error <span class="property-type">string</span></dt>
<dd>the error that occurred.</dd>
</dl>
</li>
</ol>
</script>