- Can now access the matrix client globally so it can be used in function nodes (this way you are not limited by only the nodes we have published)
- Added example for using the Matrix Client in a function to redact messages. This should be a great example to show people what is possible.
This commit is contained in:
2021-09-03 08:24:02 -06:00
parent d5519a6828
commit 6a310de708
6 changed files with 158 additions and 2 deletions
+17 -2
View File
@@ -11,7 +11,8 @@
defaults: {
name: { value: null },
autoAcceptRoomInvites: { value: true },
enableE2ee: { type: "checkbox", value: true }
enableE2ee: { type: "checkbox", value: true },
global: { type: "checkbox", value: true }
},
icon: "matrix.png",
label: function() {
@@ -67,10 +68,24 @@
Enable end-to-end encryption (requires DeviceID)
</label>
</div>
<div class="form-tips" style="margin-bottom: 12px;">
E2ee requires a Device ID to be set.
</div>
<div class="form-row">
<input
type="checkbox"
id="node-config-input-global"
style="width: auto; margin-left: 125px; vertical-align: top"
/>
<label for="node-config-input-global" style="width: auto">
Global access to Matrix Client
</label>
<div class="form-tips" style="margin-bottom: 12px;">
If enabled this allows you to access the matrix client directly with a Function node. This way you can do whatever you want with the client.<br />
Example: <code>let client = global.get("matrixClient['@bot:example.com']")</code>
</div>
</div>
</script>
<script type="text/html" data-help-name="matrix-server-config">