Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jacotec opened this issue Nov 24, 2022 · 5 comments
Closed

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

jacotec opened this issue Nov 24, 2022 · 5 comments

Comments

@jacotec
Copy link
Contributor

jacotec commented Nov 24, 2022

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:

  • Joining the room
  • Issue a command in the room
  • Invite other users into the 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
Copy link
Contributor Author

jacotec commented Nov 25, 2022

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

@skylord123
Copy link
Contributor

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
Copy link
Contributor Author

jacotec commented Dec 6, 2022

@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
Copy link
Contributor

skylord123 commented Dec 6, 2022

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants