mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2026-05-20 06:03:28 -06:00
- New react node for reacting to messages
- made input and output nodes more compatible with each other (for relay purposes). - File/Image input nodes can be combined with a File In node now - Remove console.log debug lines - set version to 0.0.3 - send message node updated to handle message formats and types. - Fixed ignore properties on matrix receive node not saving - created basic readme - WIP on node docs
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
name: { value: null },
|
||||
server: { value: "", type: "matrix-server-config" },
|
||||
roomId: { value: null },
|
||||
htmlMessage: { value: false }
|
||||
messageType: { value: 'm.text' },
|
||||
messageFormat: { value: '' },
|
||||
},
|
||||
label: function() {
|
||||
return this.name || "Send Message";
|
||||
@@ -33,14 +34,27 @@
|
||||
<input type="text" id="node-input-roomId">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="node-input-htmlMessage"
|
||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||
/>
|
||||
<label for="node-input-htmlMessage" style="width: auto">
|
||||
HTML/Markdown message
|
||||
<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>
|
||||
@@ -48,34 +62,35 @@
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="matrix-send-message">
|
||||
<p>Send an image to a matrix room.</p>
|
||||
<h3>Details</h3>
|
||||
<p>Sends a message to a Matrix room.</p>
|
||||
|
||||
<h3>Inputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>msg.payload
|
||||
<span class="property-type">File | String | Buffer | ReadStream | Blob</span>
|
||||
<span class="property-type">String</span>
|
||||
</dt>
|
||||
<dd> the contents of the image to upload. </dd>
|
||||
<dd> the message text. </dd>
|
||||
|
||||
<dt class="optional">msg.formatted_payload
|
||||
<span class="property-type">String</span>
|
||||
</dt>
|
||||
<dd> the formatted HTML message (uses msg.payload if not defined). This only affects HTML messages.</dd>
|
||||
|
||||
<dt>msg.roomId
|
||||
<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.filename
|
||||
<dt class="optional">msg.type
|
||||
<span class="property-type">String | Null</span>
|
||||
</dt>
|
||||
<dd> name of the image file to upload (optional). Overrides node configuration.</dd>
|
||||
<dd> This is only used and required when configured so on the node. Must be set to either 'm.text' or 'm.notice'</dd>
|
||||
|
||||
<dt class="optional">msg.contentType
|
||||
<dt class="optional">msg.format
|
||||
<span class="property-type">String | Null</span>
|
||||
</dt>
|
||||
<dd> Content <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types" target="_blank">MIME Type</a>. Optional if configured on the node. Overrides node configuration if set.</dd>
|
||||
|
||||
<dt class="optional">msg.body
|
||||
<span class="property-type">String | Null</span>
|
||||
</dt>
|
||||
<dd> this will be the display name the client will see when rendered in their chat client. If this is left empty the it uses <code>msg.filename</code>. If <code>msg.filename</code> is also undefined it sets it to empty string</dd>
|
||||
<dd> This is only used and required when configured so on the node. Set to null for plain text and 'html' for HTML.</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Outputs</h3>
|
||||
@@ -83,6 +98,9 @@
|
||||
<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 message.</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li>Error
|
||||
@@ -92,12 +110,4 @@
|
||||
</dl>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3>Details</h3>
|
||||
<p>This node will send an image to a Matrix chat room. You can link this directly to a File In node.</p>
|
||||
|
||||
<h3>References</h3>
|
||||
<ul>
|
||||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">MIME Types</a> - description of <code>msg.contentType</code> format</li>
|
||||
</ul>
|
||||
</script>
|
||||
Reference in New Issue
Block a user