- matrix-create-room had wrong input information listed and wrong API reference URL (fixes #14)
- fixed docs & node for matrix-receive
This commit is contained in:
parent
14badaeeb5
commit
b698389491
@ -38,19 +38,14 @@
|
|||||||
<p>
|
<p>
|
||||||
Create a room with the defined options in <code>msg.payload</code>
|
Create a room with the defined options in <code>msg.payload</code>
|
||||||
</p>
|
</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>
|
<a href="https://matrix.org/docs/spec/client_server/r0.4.0#id266" target="_blank">Matrix API Endpoint Information</a>
|
||||||
|
|
||||||
<h3>Inputs</h3>
|
<h3>Inputs</h3>
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.payload
|
<dt>msg.payload
|
||||||
<span class="property-type">string</span>
|
<span class="property-type">object</span>
|
||||||
</dt>
|
</dt>
|
||||||
<dd> a list of options to pass to the /createRoom API. <a href="https://matrix.org/docs/spec/client_server/r0.4.0#id266">Click here</a> for information about what can be passed.</dd>
|
<dd> a list of options to pass to the /createRoom API. <a href="https://matrix.org/docs/spec/client_server/r0.4.0#id266">Click here</a> for information about what can be passed.</dd>
|
||||||
|
|
||||||
<dt>msg.userId
|
|
||||||
<span class="property-type">string</span>
|
|
||||||
</dt>
|
|
||||||
<dd> User's ID that will be set into the room.</dd>
|
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h3>Outputs</h3>
|
<h3>Outputs</h3>
|
||||||
|
@ -53,7 +53,6 @@ module.exports = function(RED) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need the status code, so set onlydata to false for this request
|
|
||||||
node.server.matrixClient
|
node.server.matrixClient
|
||||||
.createRoom(msg.payload || {})
|
.createRoom(msg.payload || {})
|
||||||
.then(function(e){
|
.then(function(e){
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<p>Receive events from Matrix.</p>
|
<p>Receive events from Matrix.</p>
|
||||||
|
|
||||||
<h3>Outputs</h3>
|
<h3>Outputs</h3>
|
||||||
<ol class="node-ports">
|
<ul class="node-ports">
|
||||||
<li>Always Returned
|
<li>Always Returned
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.type <span class="property-type">string</span></dt>
|
<dt>msg.type <span class="property-type">string</span></dt>
|
||||||
@ -146,6 +146,11 @@
|
|||||||
<dd>the event object returned by the Matrix server</dd>
|
<dd>the event object returned by the Matrix server</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<dl class="message-properties">
|
||||||
|
<dt>msg.eventId <span class="property-type">object</span></dt>
|
||||||
|
<dd>The event ID, e.g. $143350589368169JsLZx:localhost</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.content <span class="property-type">object</span></dt>
|
<dt>msg.content <span class="property-type">object</span></dt>
|
||||||
<dd>the message's content object</dd>
|
<dd>the message's content object</dd>
|
||||||
@ -159,11 +164,6 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><code>msg.type</code> == '<strong>m.reaction</strong>'
|
<li><code>msg.type</code> == '<strong>m.reaction</strong>'
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.info <span class="property-type">object</span></dt>
|
|
||||||
<dd>the content's info.</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.referenceEventId <span class="property-type">string</span></dt>
|
<dt>msg.referenceEventId <span class="property-type">string</span></dt>
|
||||||
<dd>the message that the reaction relates to</dd>
|
<dd>the message that the reaction relates to</dd>
|
||||||
@ -187,39 +187,54 @@
|
|||||||
<dd>URL to the sticker image</dd>
|
<dd>URL to the sticker image</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<dl class="message-properties">
|
||||||
|
<dt>msg.mxc_url <span class="property-type">string</span></dt>
|
||||||
|
<dd>Matrix URL to the sticker image</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.thumbnail_url <span class="property-type">string</span></dt>
|
<dt>msg.thumbnail_url <span class="property-type">string</span></dt>
|
||||||
<dd>URL to the thumbnail of the sticker</dd>
|
<dd>URL to the thumbnail of the sticker</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<dl class="message-properties">
|
||||||
|
<dt>msg.thumbnail_mxc_url <span class="property-type">string</span></dt>
|
||||||
|
<dd>Matrix URL to the thumbnail of the sticker</dd>
|
||||||
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><code>msg.type</code> == '<strong>m.file</strong>'
|
<li><code>msg.type</code> == '<strong>m.file</strong>'
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.file.info <span class="property-type">string</span></dt>
|
<dt>msg.url <span class="property-type">string</span></dt>
|
||||||
<dd>the content's info.</dd>
|
<dd>the file's URL</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.file.url <span class="property-type">string</span></dt>
|
<dt>msg.mxc_url <span class="property-type">string</span></dt>
|
||||||
<dd>the file's URL</dd>
|
<dd>the file's Matrix URL</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><code>msg.type</code> == '<strong>m.image</strong>'
|
<li><code>msg.type</code> == '<strong>m.image</strong>'
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.image.info <span class="property-type">string</span></dt>
|
<dt>msg.url <span class="property-type">string</span></dt>
|
||||||
<dd>the image info.</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.file.url <span class="property-type">string</span></dt>
|
|
||||||
<dd>the image's URL</dd>
|
<dd>the image's URL</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dt>msg.file.thumbnail_url <span class="property-type">string</span></dt>
|
<dt>msg.mxc_url <span class="property-type">string</span></dt>
|
||||||
|
<dd>the image's Matrix URL</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<dl class="message-properties">
|
||||||
|
<dt>msg.thumbnail_url <span class="property-type">string</span></dt>
|
||||||
<dd>the image's thumbnail URL</dd>
|
<dd>the image's thumbnail URL</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<dl class="message-properties">
|
||||||
|
<dt>msg.thumbnail_mxc_url <span class="property-type">string</span></dt>
|
||||||
|
<dd>the image's thumbnail Matrix URL</dd>
|
||||||
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ul>
|
||||||
</script>
|
</script>
|
@ -81,10 +81,12 @@ module.exports = function(RED) {
|
|||||||
if(msg.content.info) {
|
if(msg.content.info) {
|
||||||
if(msg.content.info.thumbnail_url) {
|
if(msg.content.info.thumbnail_url) {
|
||||||
msg.thumbnail_url = node.server.matrixClient.mxcUrlToHttp(msg.content.info.thumbnail_url);
|
msg.thumbnail_url = node.server.matrixClient.mxcUrlToHttp(msg.content.info.thumbnail_url);
|
||||||
|
msg.thumbnail_mxc_url = msg.content.info.thumbnail_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(msg.content.url) {
|
if(msg.content.url) {
|
||||||
msg.url = node.server.matrixClient.mxcUrlToHttp(msg.content.url);
|
msg.url = node.server.matrixClient.mxcUrlToHttp(msg.content.url);
|
||||||
|
msg.mxc_url = msg.content.url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -25,14 +25,20 @@
|
|||||||
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
||||||
<input type="text" id="node-input-name" placeholder="Name">
|
<input type="text" id="node-input-name" placeholder="Name">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-server"><i class="fa fa-user"></i> Matrix Server Config</label>
|
<label for="node-input-server"><i class="fa fa-user"></i> Matrix Server Config</label>
|
||||||
<input type="text" id="node-input-server">
|
<input type="text" id="node-input-server">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-roomId"><i class="fa fa-user"></i> Room ID</label>
|
<label for="node-input-roomId"><i class="fa fa-user"></i> Room ID</label>
|
||||||
<input type="text" id="node-input-roomId">
|
<input type="text" id="node-input-roomId" placeholder="msg.topic">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row form-tips">
|
||||||
|
The configuration Room ID will always override <code>msg.topic</code>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-messageType">
|
<label for="node-input-messageType">
|
||||||
Message Type
|
Message Type
|
||||||
@ -42,10 +48,11 @@
|
|||||||
<option value="m.notice">m.notice</option>
|
<option value="m.notice">m.notice</option>
|
||||||
<option value="msg.type">msg.type input</option>
|
<option value="msg.type">msg.type input</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="form-tips">
|
</div>
|
||||||
|
<div class="form-row 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.
|
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>
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-messageFormat">
|
<label for="node-input-messageFormat">
|
||||||
Message Format
|
Message Format
|
||||||
@ -56,9 +63,6 @@
|
|||||||
<option value="msg.format">msg.format input</option>
|
<option value="msg.format">msg.format input</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<script type="text/html" data-help-name="matrix-send-message">
|
<script type="text/html" data-help-name="matrix-send-message">
|
||||||
@ -67,6 +71,11 @@
|
|||||||
|
|
||||||
<h3>Inputs</h3>
|
<h3>Inputs</h3>
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
|
<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 overridden.</dd>
|
||||||
|
|
||||||
<dt>msg.payload
|
<dt>msg.payload
|
||||||
<span class="property-type">String</span>
|
<span class="property-type">String</span>
|
||||||
</dt>
|
</dt>
|
||||||
@ -77,28 +86,21 @@
|
|||||||
</dt>
|
</dt>
|
||||||
<dd> the formatted HTML message (uses msg.payload if not defined). This only affects HTML messages.</dd>
|
<dd> the formatted HTML message (uses msg.payload if not defined). This only affects HTML messages.</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. Overrides node configuration if set.</dd>
|
|
||||||
|
|
||||||
<dt class="optional">msg.type
|
<dt class="optional">msg.type
|
||||||
<span class="property-type">String | Null</span>
|
<span class="property-type">String | null</span>
|
||||||
</dt>
|
</dt>
|
||||||
<dd> This is only used and required when configured so on the node. Must be set to either 'm.text' or 'm.notice'</dd>
|
<dd> This is only used and required when configured so on the node. Must be set to either <code>'m.text'</code> or <code>'m.notice'</code></dd>
|
||||||
|
|
||||||
<dt class="optional">msg.format
|
<dt class="optional">msg.format
|
||||||
<span class="property-type">String | Null</span>
|
<span class="property-type">String | null</span>
|
||||||
</dt>
|
</dt>
|
||||||
<dd> This is only used and required when configured so on the node. Set to null for plain text and 'html' for HTML.</dd>
|
<dd> This is only used and required when configured so on the node. Set to <code>null</code> for plain text and <code>'html'</code> for HTML.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h3>Outputs</h3>
|
<h3>Outputs</h3>
|
||||||
<ol class="node-ports">
|
<ol class="node-ports">
|
||||||
<li>Success
|
<li>Success
|
||||||
<dl class="message-properties">
|
<dl class="message-properties">
|
||||||
<dd>original msg object preserved.</dd>
|
|
||||||
|
|
||||||
<dt>msg.eventId <span class="property-type">string</span></dt>
|
<dt>msg.eventId <span class="property-type">string</span></dt>
|
||||||
<dd>the eventId from the posted message.</dd>
|
<dd>the eventId from the posted message.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
Loading…
Reference in New Issue
Block a user