mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-07-02 16:41:13 -06:00
- Fixed some nodes not matching how their docs describe how they function (such as node configuration should always take precedence over inputs)
73 lines
2.5 KiB
HTML
73 lines
2.5 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('matrix-invite-room', {
|
|
category: 'matrix',
|
|
color: '#00b7ca',
|
|
icon: "matrix.png",
|
|
outputLabels: ["success", "error"],
|
|
inputs: 1,
|
|
outputs: 2,
|
|
defaults: {
|
|
name: { value: null },
|
|
server: { value: "", type: "matrix-server-config" }
|
|
},
|
|
label: function() {
|
|
return this.name || "Room Invite";
|
|
},
|
|
paletteLabel: 'Room Invite'
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="matrix-invite-room">
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="matrix-invite-room">
|
|
<h3>Details</h3>
|
|
<p>
|
|
This node invites a user to participate in a particular room. They do not start participating in the room until they actually join the room. The client must be in the room and have permissions to invite.
|
|
</p>
|
|
<a href="https://matrix-org.github.io/synapse/develop/admin_api/room_membership.html#edit-room-membership-api" target="_blank">Synapse API Endpoint Information</a>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>msg.topic
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> The room identifier to invite to: for example, <code>!h8zld9j31:example.com</code>. Ignored if configured on the node, otherwise required.</dd>
|
|
|
|
<dt>msg.userId
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> User's ID that will be invited to the room.</dd>
|
|
|
|
<dt class="optional">msg.reason
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> Reason for the membership change.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Success
|
|
<dl class="message-properties">
|
|
<dt>msg.payload <span class="property-type">object</span></dt>
|
|
<dd>Currently this endpoint returns an empty object</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> |