Skylar-Tech / node-red-contrib-matrix-chat

Matrix chat server support for Node-RED
GNU General Public License v3.0
31 stars 10 forks source link

Not seeing a room invitation behind the "receive" node #70

Closed jacotec closed 1 year ago

jacotec commented 1 year ago

It looks like there's an issue with the receive node.

I need to perform some action when the user to which the plugin is connected is invited in to a room:

The actions are not the problem - but I'm not getting the invitation? Connecting a debug to the receive node, simply nothing happens.

When I set the client to "auto join rooms", I'm getting the last message as a payload - but no indication that the room was freshly joined.

Do I overlook something, or is this a bug?

jacotec commented 1 year ago

I've submitted a pull request #71 which solves this.

skylord123 commented 1 year ago

I accepted your PR and changed it up a bit so it is now it's own node. It didn't quite match the same outputs as the receive node and will be easier to use out of the box. It was also receiving old events so that is now fixed. I also added a node for leaving a room.

This will be released here soon.

Thanks!

jacotec commented 1 year ago

@skylord123 Cool, thanks! That's the most clean way (but I don't have the experience to create new nodes).

I'm looking forward to it!

BTW: Is there any way to change/set a room name via node-red?

skylord123 commented 1 year ago

set-room-name-or-topic.json.txt

^ import that in Node-RED. Once imported edit the function Node's first line to match the user ID of your matrix client.

You have raw access to the matrixClient using these function nodes and can call any of the methods from the matrix-js-sdk client.ts file found here: https://github.com/matrix-org/matrix-js-sdk/blob/master/src/client.ts#L3713

All I did was take the example function from our examples on here and modified it to use the method setRoomName from matrix.ts. There was also a setRoomTopic so I also included an example for that.

So you can almost do whatever you want using these function nodes since the client is exposed there. There is a lot of functionality that would just be insane to create a node for every single one so this was my way to let people get around that.

EDIT: The server config node will need to have global access enabled for this to work

skylord123 commented 1 year ago

This is now live on version v0.7.0. Thanks!