mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-07-08 11:41:07 -06:00
Compare commits
5 Commits
913f5dfcb9
...
ad34f018ab
Author | SHA1 | Date | |
---|---|---|---|
ad34f018ab | |||
20345787d2 | |||
99c19923c6 | |||
093d59893e | |||
|
cf82daf5da |
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
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)
|
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
|
### Features
|
||||||
|
|
||||||
Supported functionality in this package includes:
|
Supported functionality in this package includes:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-contrib-matrix-chat",
|
"name": "node-red-contrib-matrix-chat",
|
||||||
"version": "0.8.0",
|
"version": "0.9.0",
|
||||||
"description": "Matrix chat server client for Node-RED",
|
"description": "Matrix chat server client for Node-RED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
|
@ -19,14 +19,18 @@
|
|||||||
},
|
},
|
||||||
oneditprepare: function() {
|
oneditprepare: function() {
|
||||||
$("#node-input-roomId").typedInput({
|
$("#node-input-roomId").typedInput({
|
||||||
type: this.roomIdType,
|
types: ['msg','flow','global','str'],
|
||||||
types:['msg','flow','global','str'],
|
typeField: "#node-input-roomId"
|
||||||
}).typedInput('value', this.roomIdValue);
|
});
|
||||||
|
$("#node-input-roomId").typedInput("type", this.roomIdType || "msg");
|
||||||
|
$("#node-input-roomId").typedInput("value", this.roomIdValue || "topic");
|
||||||
|
|
||||||
$("#node-input-eventId").typedInput({
|
$("#node-input-eventId").typedInput({
|
||||||
type: this.eventIdType,
|
types: ['msg','flow','global','str'],
|
||||||
types:['msg','flow','global','str'],
|
typeField: "#node-input-eventId"
|
||||||
}).typedInput('value', this.eventIdValue);
|
});
|
||||||
|
$("#node-input-eventId").typedInput("type", this.eventIdType || "msg");
|
||||||
|
$("#node-input-eventId").typedInput("value", this.eventIdValue || "eventId");
|
||||||
},
|
},
|
||||||
oneditsave: function() {
|
oneditsave: function() {
|
||||||
this.roomIdType = $("#node-input-roomId").typedInput('type');
|
this.roomIdType = $("#node-input-roomId").typedInput('type');
|
||||||
@ -58,18 +62,6 @@
|
|||||||
<label for="node-input-eventId"><i class="fa fa-file"></i> Event ID</label>
|
<label for="node-input-eventId"><i class="fa fa-file"></i> Event ID</label>
|
||||||
<input type="text" id="node-input-eventId">
|
<input type="text" id="node-input-eventId">
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<script type="text/html" data-help-name="matrix-get-event">
|
<script type="text/html" data-help-name="matrix-get-event">
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
name: { value: null },
|
name: { value: null },
|
||||||
autoAcceptRoomInvites: { value: true },
|
autoAcceptRoomInvites: { value: true },
|
||||||
enableE2ee: { type: "checkbox", value: true },
|
enableE2ee: { type: "checkbox", value: true },
|
||||||
global: { type: "checkbox", value: true }
|
global: { type: "checkbox", value: true },
|
||||||
|
allowUnknownDevices: { type: "checkbox", value: false }
|
||||||
},
|
},
|
||||||
icon: "matrix.png",
|
icon: "matrix.png",
|
||||||
label: function() {
|
label: function() {
|
||||||
@ -130,6 +131,20 @@
|
|||||||
<code style="white-space: normal;">let client = global.get("matrixClient['@bot:example.com']");</code>
|
<code style="white-space: normal;">let client = global.get("matrixClient['@bot:example.com']");</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="node-config-input-allowUnknownDevices"
|
||||||
|
style="width: auto; margin-left: 125px; vertical-align: top"
|
||||||
|
/>
|
||||||
|
<label for="node-config-input-allowUnknownDevices" style="width: auto">
|
||||||
|
Allow unverified devices in rooms
|
||||||
|
</label>
|
||||||
|
<div class="form-tips" style="margin-bottom: 12px;">
|
||||||
|
Allow sending messages to a room with unknown devices which have not been verified.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#matrix-login-btn").on("click", function() {
|
$("#matrix-login-btn").on("click", function() {
|
||||||
function prettyPrintJson(json) {
|
function prettyPrintJson(json) {
|
||||||
|
@ -55,6 +55,7 @@ module.exports = function(RED) {
|
|||||||
this.autoAcceptRoomInvites = n.autoAcceptRoomInvites;
|
this.autoAcceptRoomInvites = n.autoAcceptRoomInvites;
|
||||||
this.e2ee = n.enableE2ee || false;
|
this.e2ee = n.enableE2ee || false;
|
||||||
this.globalAccess = n.global;
|
this.globalAccess = n.global;
|
||||||
|
this.allowUnknownDevices = n.allowUnknownDevices || false;
|
||||||
this.initializedAt = new Date();
|
this.initializedAt = new Date();
|
||||||
node.initialSyncLimit = 25;
|
node.initialSyncLimit = 25;
|
||||||
|
|
||||||
@ -399,6 +400,7 @@ module.exports = function(RED) {
|
|||||||
node.log("Initializing crypto...");
|
node.log("Initializing crypto...");
|
||||||
await node.matrixClient.initCrypto();
|
await node.matrixClient.initCrypto();
|
||||||
node.matrixClient.getCrypto().globalBlacklistUnverifiedDevices = false; // prevent errors from unverified devices
|
node.matrixClient.getCrypto().globalBlacklistUnverifiedDevices = false; // prevent errors from unverified devices
|
||||||
|
node.matrixClient.getCrypto().globalErrorOnUnknownDevices = !node.allowUnknownDevices;
|
||||||
}
|
}
|
||||||
node.log("Connecting to Matrix server...");
|
node.log("Connecting to Matrix server...");
|
||||||
await node.matrixClient.startClient({
|
await node.matrixClient.startClient({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user