mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-07-08 03:31:05 -06:00
Compare commits
8 Commits
9005ba579c
...
afda5d1cd6
Author | SHA1 | Date | |
---|---|---|---|
|
afda5d1cd6 | ||
e0947dd3bc | |||
8287f3c08a | |||
|
2a78524a90 | ||
|
d01838ac84 | ||
|
2059f8455d | ||
|
77f2c4be46 | ||
|
cf82daf5da |
@ -13,6 +13,7 @@
|
||||
acceptOwnEvents: {"value": false},
|
||||
acceptText: {"value": true},
|
||||
acceptEmotes: {"value": true},
|
||||
acceptNotices: {"value": true},
|
||||
acceptStickers: {"value": true},
|
||||
acceptReactions: {"value": true},
|
||||
acceptFiles: {"value": true},
|
||||
@ -66,6 +67,16 @@
|
||||
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,6 +10,7 @@ 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;
|
||||
@ -69,6 +70,10 @@ 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(!msg.format) {
|
||||
if(!Object.hasOwn(msg, 'format')) {
|
||||
node.error("Message format is set to be passed in via msg.format but was not defined", msg);
|
||||
return;
|
||||
}
|
||||
|
@ -36,7 +36,8 @@
|
||||
name: { value: null },
|
||||
autoAcceptRoomInvites: { 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",
|
||||
label: function() {
|
||||
@ -130,6 +131,20 @@
|
||||
<code style="white-space: normal;">let client = global.get("matrixClient['@bot:example.com']");</code>
|
||||
</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">
|
||||
$("#matrix-login-btn").on("click", function() {
|
||||
function prettyPrintJson(json) {
|
||||
|
@ -56,6 +56,7 @@ module.exports = function(RED) {
|
||||
this.autoAcceptRoomInvites = n.autoAcceptRoomInvites;
|
||||
this.e2ee = n.enableE2ee || false;
|
||||
this.globalAccess = n.global;
|
||||
this.allowUnknownDevices = n.allowUnknownDevices || false;
|
||||
this.initializedAt = new Date();
|
||||
node.initialSyncLimit = 25;
|
||||
|
||||
@ -401,6 +402,7 @@ module.exports = function(RED) {
|
||||
node.log("Initializing crypto...");
|
||||
await node.matrixClient.initCrypto();
|
||||
node.matrixClient.getCrypto().globalBlacklistUnverifiedDevices = false; // prevent errors from unverified devices
|
||||
node.matrixClient.getCrypto().globalErrorOnUnknownDevices = !node.allowUnknownDevices;
|
||||
}
|
||||
node.log("Connecting to Matrix server...");
|
||||
await node.matrixClient.startClient({
|
||||
|
Loading…
x
Reference in New Issue
Block a user