mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2026-05-19 13:43:07 -06:00
Compare commits
1 Commits
v0.9.0
..
1d770e7d0b
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d770e7d0b |
@@ -5,8 +5,6 @@
|
||||
|
||||
Join our public Matrix room for help: [#node-red-contrib-matrix-chat:skylar.tech](https://app.element.io/#/room/#node-red-contrib-matrix-chat:skylar.tech)
|
||||
|
||||
[](https://ko-fi.com/B0B51BM7C)
|
||||
|
||||
### Features
|
||||
|
||||
Supported functionality in this package includes:
|
||||
@@ -61,9 +59,7 @@ Interested in helping? Contributions to finalize E2EE support are welcome!
|
||||
|
||||
This module includes a node to register users using the Synapse secret registration endpoint. It returns both an `access_token` and a `device_id`, perfect for setting up the bot.
|
||||
|
||||
[Guide on registering a user via the web browser](https://skylar.tech/matrix-chat-bot-module-for-node-red/)
|
||||
|
||||
[Guide on registering using shared secret registration](https://github.com/Skylar-Tech/node-red-contrib-matrix-chat/tree/master/examples#readme) (for server owners)
|
||||
[See how to register a user here](https://github.com/Skylar-Tech/node-red-contrib-matrix-chat/tree/master/examples#readme).
|
||||
|
||||
### Other Packages
|
||||
|
||||
|
||||
Generated
+734
-132
File diff suppressed because it is too large
Load Diff
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-matrix-chat",
|
||||
"version": "0.9.0",
|
||||
"version": "0.8.0",
|
||||
"description": "Matrix chat server client for Node-RED",
|
||||
"dependencies": {
|
||||
"abort-controller": "^3.0.0",
|
||||
@@ -9,11 +9,12 @@
|
||||
"got": "^12.0.2",
|
||||
"image-size": "^1.0.2",
|
||||
"isomorphic-webcrypto": "^2.3.8",
|
||||
"matrix-js-sdk": "34.11.1",
|
||||
"matrix-js-sdk": "^28.0.0",
|
||||
"mime": "^3.0.0",
|
||||
"node-fetch": "^3.3.0",
|
||||
"node-localstorage": "^2.2.1",
|
||||
"olm": "https://gitlab.matrix.org/matrix-org/olm/-/package_files/2572/download",
|
||||
"request": "^2.88.2",
|
||||
"sharp": "^0.33.4",
|
||||
"tmp": "^0.2.1",
|
||||
"utf8": "^3.0.0"
|
||||
|
||||
+18
-10
@@ -19,18 +19,14 @@
|
||||
},
|
||||
oneditprepare: function() {
|
||||
$("#node-input-roomId").typedInput({
|
||||
types: ['msg','flow','global','str'],
|
||||
typeField: "#node-input-roomId"
|
||||
});
|
||||
$("#node-input-roomId").typedInput("type", this.roomIdType || "msg");
|
||||
$("#node-input-roomId").typedInput("value", this.roomIdValue || "topic");
|
||||
type: this.roomIdType,
|
||||
types:['msg','flow','global','str'],
|
||||
}).typedInput('value', this.roomIdValue);
|
||||
|
||||
$("#node-input-eventId").typedInput({
|
||||
types: ['msg','flow','global','str'],
|
||||
typeField: "#node-input-eventId"
|
||||
});
|
||||
$("#node-input-eventId").typedInput("type", this.eventIdType || "msg");
|
||||
$("#node-input-eventId").typedInput("value", this.eventIdValue || "eventId");
|
||||
type: this.eventIdType,
|
||||
types:['msg','flow','global','str'],
|
||||
}).typedInput('value', this.eventIdValue);
|
||||
},
|
||||
oneditsave: function() {
|
||||
this.roomIdType = $("#node-input-roomId").typedInput('type');
|
||||
@@ -62,6 +58,18 @@
|
||||
<label for="node-input-eventId"><i class="fa fa-file"></i> Event ID</label>
|
||||
<input type="text" id="node-input-eventId">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#node-input-roomId").on("keyup", function() {
|
||||
if($(this).val() && !$(this).val().startsWith("!")) {
|
||||
$("#node-input-roomId-error").html(`Room IDs start with exclamation point "!"<br />Example: !OGEhHVWSdvArJzumhm:matrix.org`).show();
|
||||
} else {
|
||||
$("#node-input-roomId-error").hide();
|
||||
}
|
||||
}).trigger('keyup');
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="matrix-get-event">
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
acceptOwnEvents: {"value": false},
|
||||
acceptText: {"value": true},
|
||||
acceptEmotes: {"value": true},
|
||||
acceptNotices: {"value": true},
|
||||
acceptStickers: {"value": true},
|
||||
acceptReactions: {"value": true},
|
||||
acceptFiles: {"value": true},
|
||||
@@ -67,16 +66,6 @@
|
||||
Accept text <code style="text-transform: none;">m.text</code>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-row" style="margin-bottom:0;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="node-input-acceptNotices"
|
||||
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||
/>
|
||||
<label for="node-input-acceptNotices" style="width: auto">
|
||||
Accept notices <code style="text-transform: none;">m.notice</code>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-row" style="margin-bottom:0;">
|
||||
<input
|
||||
type="checkbox"
|
||||
|
||||
@@ -10,7 +10,6 @@ module.exports = function(RED) {
|
||||
this.acceptOwnEvents = n.acceptOwnEvents;
|
||||
this.acceptText = n.acceptText;
|
||||
this.acceptEmotes = n.acceptEmotes;
|
||||
this.acceptNotices = n.acceptNotices;
|
||||
this.acceptStickers = n.acceptStickers;
|
||||
this.acceptReactions = n.acceptReactions;
|
||||
this.acceptFiles = n.acceptFiles;
|
||||
@@ -70,10 +69,6 @@ module.exports = function(RED) {
|
||||
if (!node.acceptEmotes) return;
|
||||
break;
|
||||
|
||||
case 'm.notice':
|
||||
if (!node.acceptNotices) return;
|
||||
break;
|
||||
|
||||
case 'm.text':
|
||||
if (!node.acceptText) return;
|
||||
break;
|
||||
|
||||
@@ -127,7 +127,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
if(msgFormat === 'msg.format') {
|
||||
if(!Object.hasOwn(msg, 'format')) {
|
||||
if(!msg.format) {
|
||||
node.error("Message format is set to be passed in via msg.format but was not defined", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ const { resolve } = require('path');
|
||||
const { LocalStorage } = require('node-localstorage');
|
||||
const { LocalStorageCryptoStore } = require('matrix-js-sdk/lib/crypto/store/localStorage-crypto-store');
|
||||
const {RoomEvent, RoomMemberEvent, HttpApiEvent, ClientEvent, MemoryStore} = require("matrix-js-sdk");
|
||||
const request = require("request");
|
||||
require("abort-controller/polyfill"); // polyfill abort-controller if we don't have it
|
||||
if (!globalThis.fetch) {
|
||||
// polyfill fetch if we don't have it
|
||||
@@ -153,7 +154,8 @@ module.exports = function(RED) {
|
||||
localStorage: localStorage,
|
||||
}),
|
||||
userId: this.userId,
|
||||
deviceId: (this.deviceId || getStoredDeviceId(localStorage)) || undefined
|
||||
deviceId: (this.deviceId || getStoredDeviceId(localStorage)) || undefined,
|
||||
request
|
||||
// verificationMethods: ["m.sas.v1"]
|
||||
});
|
||||
|
||||
@@ -479,7 +481,8 @@ module.exports = function(RED) {
|
||||
baseUrl: baseUrl,
|
||||
deviceId: deviceId,
|
||||
timelineSupport: true,
|
||||
localTimeoutMs: '30000'
|
||||
localTimeoutMs: '30000',
|
||||
request
|
||||
});
|
||||
|
||||
new TimelineWindow()
|
||||
|
||||
Reference in New Issue
Block a user