Merge pull request #71 from jacotec/master

Pass invites to the receive object
This commit is contained in:
Skylar Sadlier 2022-12-05 21:20:11 -07:00 committed by GitHub
commit 0a34870fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -32,6 +32,12 @@ module.exports = function(RED) {
node.status({ fill: "green", shape: "ring", text: "connected" });
});
node.server.on("Room.invite", async function(msg) {
node.send(msg);
});
node.server.on("Room.timeline", async function(event, room, toStartOfTimeline, removed, data, msg) {
// if node has a room ID set we only listen on that room
if(node.roomIds.length && node.roomIds.indexOf(room.roomId) === -1) {

View File

@ -260,6 +260,13 @@ module.exports = function(RED) {
});
} else {
node.log("Got invite to join room " + member.roomId);
let msg = {
type : 'r.invite',
payload : 'Invitation',
userId : member.userId,
topic : member.roomId
};
node.emit("Room.invite", msg);
}
}
});