mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-19 12:33:06 -06:00
- Can now configure a room on the invite-room node (instead of having to pass it in on the msg) - Changed how the connection event was handled by nodes - matrix-synapse-join-room node was broken (was trying to access a variable that was never defined). - olm library updated to 3.2.1 to hopefully fix "account.generate_fallback_key is not a function" Fixes #26 - Added description to the server configuration node that describes how to create a user for use with this module - Update link to create room api for matrix-create-room.html
79 lines
2.8 KiB
HTML
79 lines
2.8 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" },
|
|
roomId: { value: null },
|
|
},
|
|
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>
|
|
|
|
<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>
|
|
</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> |