mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2026-05-13 18:31:16 -06:00
Closes #21
- 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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user