Skip to content

Commit

Permalink
Merge pull request #127 from koosc/allow-unknown
Browse files Browse the repository at this point in the history
Add option for allowing unknown devices in rooms
  • Loading branch information
skylord123 authored Feb 8, 2025
2 parents 2034578 + cf82daf commit ad34f01
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/matrix-server-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/matrix-server-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,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;

Expand Down Expand Up @@ -399,6 +400,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({
Expand Down

0 comments on commit ad34f01

Please sign in to comment.