mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-20 04:53:06 -06:00
- Fixed some nodes not matching how their docs describe how they function (such as node configuration should always take precedence over inputs)
82 lines
3.1 KiB
HTML
82 lines
3.1 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('matrix-join-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 || "Join Room";
|
|
},
|
|
paletteLabel: 'Join Room'
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="matrix-join-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-join-room">
|
|
<h3>Details</h3>
|
|
<p>This node starts the client participating in a particular room, if the client is allowed to participate in that room. After this call, the client is allowed to see all current state events in the room, and all subsequent events associated with the room until the user leaves the room.</p>
|
|
<a href="https://matrix.org/docs/spec/client_server/latest#id291" target="_blank">Matrix 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 or alias to join.</dd>
|
|
|
|
<dt class="optional">msg.joinOpts
|
|
<span class="property-type">object | null</span>
|
|
</dt>
|
|
<dd> Extra options that can be passed when joining a room.</dd>
|
|
|
|
<dt class="optional">msg.joinOpts.syncRoom
|
|
<span class="property-type">bool</span>
|
|
</dt>
|
|
<dd> True to do a room initial sync on the resulting room. If false, the returned Room object will have no current state. Default: true.</dd>
|
|
|
|
<dt class="optional">msg.joinOpts.inviteSignUrl
|
|
<span class="property-type">bool</span>
|
|
</dt>
|
|
<dd> If the caller has a keypair 3pid invite, the signing URL is passed in this parameter.</dd>
|
|
|
|
<dt class="optional">msg.joinOpts.viaServers
|
|
<span class="property-type">[string]</span>
|
|
</dt>
|
|
<dd> The servers to attempt to join the room through. One of the servers must be participating in the room.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Success
|
|
<dl class="message-properties">
|
|
<dt>msg.topic <span class="property-type">string</span></dt>
|
|
<dd>ID of the joined room.</dd>
|
|
|
|
<dt>msg.payload <span class="property-type">object</span></dt>
|
|
<dd>Room 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> |