Compare commits

...

6 Commits

Author SHA1 Message Date
e0947dd3bc
Merge pull request #128 from wuast94/master
Add m.notice to the receive node
2025-02-03 20:54:40 -07:00
8287f3c08a
Merge pull request #130 from LokiMidgard/patch-1
Support default plaintext in msg.format
2025-02-03 20:51:43 -07:00
Patrick Kranz
2a78524a90
use hasOwn instead of keys 2025-01-09 15:28:28 +01:00
Patrick Kranz
d01838ac84
Fix error 2025-01-09 15:14:50 +01:00
Patrick Kranz
2059f8455d
Update matrix-send-message.js 2025-01-09 15:12:09 +01:00
Marc
77f2c4be46 Add m.notice to the receive node 2025-01-01 05:17:12 +00:00
3 changed files with 18 additions and 2 deletions

View File

@ -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"

View File

@ -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;

View File

@ -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;
}
@ -202,4 +202,4 @@ module.exports = function(RED) {
});
}
RED.nodes.registerType("matrix-send-message", MatrixSendImage);
}
}