mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2026-05-21 06:33:16 -06:00
- Reduce margin between checkboxes for matrix-receive node
- matrix-send-message node can now be used to reply in a thread (closes #104) - matrix-receive node now returns msg.mentions for easier access to who was mentioned in message - matrix-receive node now returns boolean msg.isThread based on whether the message is a thread reply or not
This commit is contained in:
+14
-10
@@ -1,3 +1,5 @@
|
||||
const {RelationType} = require("matrix-js-sdk");
|
||||
|
||||
global.Olm = require('olm');
|
||||
const fs = require("fs-extra");
|
||||
const sdk = require("matrix-js-sdk");
|
||||
@@ -225,16 +227,18 @@ module.exports = function(RED) {
|
||||
};
|
||||
|
||||
let msg = {
|
||||
encrypted : event.isEncrypted(),
|
||||
redacted : event.isRedacted(),
|
||||
content : event.getContent(),
|
||||
type : (event.getContent()['msgtype'] || event.getType()) || null,
|
||||
payload : (event.getContent()['body'] || event.getContent()) || null,
|
||||
isDM : isDmRoom(room),
|
||||
userId : event.getSender(),
|
||||
topic : event.getRoomId(),
|
||||
eventId : event.getId(),
|
||||
event : event
|
||||
encrypted : event.isEncrypted(),
|
||||
redacted : event.isRedacted(),
|
||||
content : event.getContent(),
|
||||
type : (event.getContent()['msgtype'] || event.getType()) || null,
|
||||
payload : (event.getContent()['body'] || event.getContent()) || null,
|
||||
isDM : isDmRoom(room),
|
||||
isThread : event.getContent()?.['m.relates_to']?.rel_type === RelationType.Thread,
|
||||
mentions : event.getContent()["m.mentions"] || null,
|
||||
userId : event.getSender(),
|
||||
topic : event.getRoomId(),
|
||||
eventId : event.getId(),
|
||||
event : event,
|
||||
};
|
||||
|
||||
node.log("Received" + (msg.encrypted ? ' encrypted' : '') +" timeline event [" + msg.type + "]: (" + room.name + ") " + event.getSender() + " :: " + msg.content.body + (toStartOfTimeline ? ' [PAGINATED]' : ''));
|
||||
|
||||
Reference in New Issue
Block a user