mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-07-09 12:11:10 -06:00
Compare commits
No commits in common. "97f27e61c64428679b23e7d011a4ed75d61bb33e" and "9f41b67174349d759534c2df6788ae1a100a74d7" have entirely different histories.
97f27e61c6
...
9f41b67174
@ -1,5 +1,5 @@
|
|||||||
# node-red-contrib-matrix-chat
|
# node-red-contrib-matrix-chat
|
||||||
[Matrix](https://matrix.org/) chat server client for [Node-RED](https://nodered.org/)
|
Matrix chat server client for [Node-RED](https://nodered.org/)
|
||||||
|
|
||||||
***Currently we are in beta. We ask that you open any issues you have on our repository to help us reach a stable well tested version. Things may change & break before our first release so check changelog before updating.***
|
***Currently we are in beta. We ask that you open any issues you have on our repository to help us reach a stable well tested version. Things may change & break before our first release so check changelog before updating.***
|
||||||
|
|
||||||
@ -11,10 +11,8 @@ The following is supported from this package:
|
|||||||
|
|
||||||
- End-to-end encryption
|
- End-to-end encryption
|
||||||
- [Currently a WIP](#end-to-end-encryption-notes)
|
- [Currently a WIP](#end-to-end-encryption-notes)
|
||||||
- Receive events from a room (messages, reactions, images, audio, locations, and files) whether encrypted or not
|
- Receive events from a room (messages, reactions, images, and files) whether encrypted or not
|
||||||
- Send Images/Files (sending files to e2ee room doesn't currently encrypt them yet)
|
- Send Images/Files (sending files to e2ee room doesn't currently encrypt them yet)
|
||||||
- Edit messages
|
|
||||||
- Delete events (messages, reactions, etc)
|
|
||||||
- Decrypt files in e2ee rooms
|
- Decrypt files in e2ee rooms
|
||||||
- Send HTML/Plain Text Message/Notice
|
- Send HTML/Plain Text Message/Notice
|
||||||
- React to messages
|
- React to messages
|
||||||
|
@ -15,9 +15,7 @@
|
|||||||
acceptStickers: {"value": true},
|
acceptStickers: {"value": true},
|
||||||
acceptReactions: {"value": true},
|
acceptReactions: {"value": true},
|
||||||
acceptFiles: {"value": true},
|
acceptFiles: {"value": true},
|
||||||
acceptAudio: {"value": true},
|
|
||||||
acceptImages: {"value": true},
|
acceptImages: {"value": true},
|
||||||
acceptLocations: {"value": true},
|
|
||||||
},
|
},
|
||||||
label: function() {
|
label: function() {
|
||||||
return this.name || "Matrix Receive";
|
return this.name || "Matrix Receive";
|
||||||
@ -51,7 +49,7 @@
|
|||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
/>
|
/>
|
||||||
<label for="node-input-acceptText" style="width: auto">
|
<label for="node-input-acceptText" style="width: auto">
|
||||||
Accept text <code style="text-transform: none;">m.text</code>
|
Accept text <code>m.text</code>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -61,7 +59,7 @@
|
|||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
/>
|
/>
|
||||||
<label for="node-input-acceptEmotes" style="width: auto">
|
<label for="node-input-acceptEmotes" style="width: auto">
|
||||||
Accept emotes <code style="text-transform: none;">m.emote</code>
|
Accept emotes <code>m.emote</code>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -71,7 +69,7 @@
|
|||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
/>
|
/>
|
||||||
<label for="node-input-acceptStickers" style="width: auto">
|
<label for="node-input-acceptStickers" style="width: auto">
|
||||||
Accept stickers <code style="text-transform: none;">m.sticker</code>
|
Accept stickers <code>m.sticker</code>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -81,7 +79,7 @@
|
|||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
/>
|
/>
|
||||||
<label for="node-input-acceptReactions" style="width: auto">
|
<label for="node-input-acceptReactions" style="width: auto">
|
||||||
Accept reactions <code style="text-transform: none;">m.reaction</code>
|
Accept reactions <code>m.reaction</code>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -91,17 +89,7 @@
|
|||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
/>
|
/>
|
||||||
<label for="node-input-acceptFiles" style="width: auto">
|
<label for="node-input-acceptFiles" style="width: auto">
|
||||||
Accept files <code style="text-transform: none;">m.file</code>
|
Accept files <code>m.file</code>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id="node-input-acceptAudio"
|
|
||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
|
||||||
/>
|
|
||||||
<label for="node-input-acceptAudio" style="width: auto">
|
|
||||||
Accept files <code style="text-transform: none;">m.audio</code>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -111,17 +99,7 @@
|
|||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
/>
|
/>
|
||||||
<label for="node-input-acceptImages" style="width: auto">
|
<label for="node-input-acceptImages" style="width: auto">
|
||||||
Accept images <code style="text-transform: none;">m.image</code>
|
Accept images <code>m.image</code>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id="node-input-acceptLocations"
|
|
||||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
|
||||||
/>
|
|
||||||
<label for="node-input-acceptLocations" style="width: auto">
|
|
||||||
Accept locations <code style="text-transform: none;">m.location</code>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -259,38 +237,6 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><code>msg.type</code> == '<strong>m.audio</strong>'
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.filename <span class="property-type">string</span></dt>
|
|
||||||
<dd>the image's parsed filename</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.mimetype <span class="property-type">string</span></dt>
|
|
||||||
<dd>audio file mimetype (ex: audio/ogg)</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.url <span class="property-type">string</span></dt>
|
|
||||||
<dd>the file's URL</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.mxc_url <span class="property-type">string</span></dt>
|
|
||||||
<dd>the file's Matrix URL</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.duration <span class="property-type">integer</span></dt>
|
|
||||||
<dd>duration of audio file in milliseconds</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.waveform <span class="property-type">array[int]</span></dt>
|
|
||||||
<dd>waveform of the audio clip</dd>
|
|
||||||
</dl>
|
|
||||||
</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.filename <span class="property-type">string</span></dt>
|
<dt>msg.filename <span class="property-type">string</span></dt>
|
||||||
@ -317,12 +263,5 @@
|
|||||||
<dd>the image's thumbnail Matrix URL</dd>
|
<dd>the image's thumbnail Matrix URL</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><code>msg.type</code> == '<strong>m.location</strong>'
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>msg.geo_uri <span class="property-type">string</span></dt>
|
|
||||||
<dd>URI format of the geolocation</dd>
|
|
||||||
</dl>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</script>
|
</script>
|
@ -11,9 +11,7 @@ module.exports = function(RED) {
|
|||||||
this.acceptStickers = n.acceptStickers;
|
this.acceptStickers = n.acceptStickers;
|
||||||
this.acceptReactions = n.acceptReactions;
|
this.acceptReactions = n.acceptReactions;
|
||||||
this.acceptFiles = n.acceptFiles;
|
this.acceptFiles = n.acceptFiles;
|
||||||
this.acceptAudio = n.acceptAudio;
|
|
||||||
this.acceptImages = n.acceptImages;
|
this.acceptImages = n.acceptImages;
|
||||||
this.acceptLocations = n.acceptLocations;
|
|
||||||
this.roomId = n.roomId;
|
this.roomId = n.roomId;
|
||||||
this.roomIds = this.roomId ? this.roomId.split(',') : [];
|
this.roomIds = this.roomId ? this.roomId.split(',') : [];
|
||||||
|
|
||||||
@ -74,27 +72,6 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm.audio':
|
|
||||||
if(!node.acceptAudio) return;
|
|
||||||
if(msg.encrypted) {
|
|
||||||
msg.url = node.server.matrixClient.mxcUrlToHttp(msg.content.file.url);
|
|
||||||
msg.mxc_url = msg.content.file.url;
|
|
||||||
} else {
|
|
||||||
msg.url = node.server.matrixClient.mxcUrlToHttp(msg.content.url);
|
|
||||||
msg.mxc_url = msg.content.url;
|
|
||||||
}
|
|
||||||
|
|
||||||
if('org.matrix.msc1767.file' in msg.content) {
|
|
||||||
msg.filename = msg.content['org.matrix.msc1767.file'].name;
|
|
||||||
msg.mimetype = msg.content['org.matrix.msc1767.file'].mimetype;
|
|
||||||
}
|
|
||||||
|
|
||||||
if('org.matrix.msc1767.audio' in msg.content) {
|
|
||||||
msg.duration = msg.content['org.matrix.msc1767.audio'].duration;
|
|
||||||
msg.waveform = msg.content['org.matrix.msc1767.audio'].waveform;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'm.image':
|
case 'm.image':
|
||||||
if(!node.acceptImages) return;
|
if(!node.acceptImages) return;
|
||||||
msg.filename = msg.content.filename || msg.content.body;
|
msg.filename = msg.content.filename || msg.content.body;
|
||||||
@ -111,12 +88,6 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm.location':
|
|
||||||
if(!node.acceptLocations) return;
|
|
||||||
msg.geo_uri = msg.content.geo_uri;
|
|
||||||
msg.payload = msg.content.body;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'm.reaction':
|
case 'm.reaction':
|
||||||
if(!node.acceptReactions) return;
|
if(!node.acceptReactions) return;
|
||||||
msg.info = msg.content["m.relates_to"].info;
|
msg.info = msg.content["m.relates_to"].info;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user