Files
node-red-contrib-matrix-cha…/src/matrix-react.html
Skylar Sadlier b33595d5eb - 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.
2021-08-18 11:18:29 -06:00

102 lines
3.7 KiB
HTML

<script type="text/javascript">
RED.nodes.registerType('matrix-react',{
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 || "React";
},
paletteLabel: 'React'
});
</script>
<script type="text/html" data-template-name="matrix-react">
<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">
</div>
<div class="form-row">
<label for="node-input-messageType">
Message Type
</label>
<select id="node-input-messageType">
<option value="m.text">m.text</option>
<option value="m.notice">m.notice</option>
<option value="msg.type">msg.type input</option>
</select>
<div class="form-tips">
It's recommended to use m.notice for bots because the message will render in a lighter text (at least in Element client) for users to distinguish bot and real user messages.
</div>
</div>
<div class="form-row">
<label for="node-input-messageFormat">
Message Format
</label>
<select id="node-input-messageFormat">
<option value="">Default (plaintext)</option>
<option value="html">HTML</option>
<option value="msg.format">msg.format input</option>
</select>
</div>
<div class="form-tips">
Must be a valid <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types" target="_blank">MIME Type</a>
</div>
</script>
<script type="text/html" data-help-name="matrix-react">
<h3>Details</h3>
<p>React to a message in a Matrix room.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>msg.payload
<span class="property-type">String</span>
</dt>
<dd> Usually an emoji but can also be text. </dd>
<dt>msg.topic
<span class="property-type">String | Null</span>
</dt>
<dd> Room ID to send image to. Optional if configured on the node. If configured on the node this will be ignored.</dd>
<dt class="optional">msg.referenceEventId<br />
msg.eventId
<span class="property-type">String</span>
</dt>
<dd> The eventId of the message to react to. Uses <code>msg.referenceEventId</code> first and falls back to <code>msg.eventId</code>. One of these MUST be defined.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Success
<dl class="message-properties">
<dd>original msg object preserved.</dd>
<dt>msg.eventId <span class="property-type">string</span></dt>
<dd>the eventId from the posted reaction.</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>