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

use with public servers #24

Closed cthompstone closed 2 years ago

cthompstone commented 2 years ago

Hi very new to this... sorry.... Can this node be used with matrix.org ? I was going to create a simple flow to allow control in nodered using a matrix.org room. So I made a room on matrix.org (unencrypted) copied the token from the account I used. left device ID blank set the room, userid etc put debug node on the end of receive node On sending a message to the room (from another account) the debug gives: TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 7 times...

Am I doing something wrong?

skylord123 commented 2 years ago

This is really strange. That function definitely exists and will function whether the client has encryption enabled or not..

I just created an account on the matrix.org server, created an un-encrypted room, invited myself from my other server, and test sent a message and it came through:

image

I even tried enabling and disabling e2ee to see if it would make the function undefined and the messages still came through.

Is there any extra details in your log? What operating system is your host? Are you running Node-RED in docker? Do you have any other Matrix clients installed in Node-RED?

cthompstone commented 2 years ago

logs (not very helpful): 10 Sep 11:18:38 - [info] Stopping modified nodes 10 Sep 11:18:38 - [info] Stopped modified nodes 10 Sep 11:18:38 - [info] Starting modified nodes 10 Sep 11:18:38 - [info] Started modified nodes 10 Sep 11:18:58 - [info] Stopping modified nodes 10 Sep 11:18:58 - [info] Stopped modified nodes 10 Sep 11:18:58 - [info] Starting modified nodes 10 Sep 11:18:58 - [info] [matrix-server-config:roll] Initializing Matrix Server Config node 10 Sep 11:18:58 - [info] [matrix-server-config:roll] Connecting to Matrix server... Getting saved sync token... Getting push rules... 10 Sep 11:18:58 - [info] Started modified nodes Got saved sync token Getting saved sync... Got reply from saved sync, exists? false Got push rules Checking lazy load status... Checking whether lazy loading has changed in store... Storing client options... Stored client options Getting filter... Sending first sync request... Waiting for saved sync before starting sync processing... 10 Sep 11:18:59 - [info] [matrix-server-config:roll****] Matrix server connection ready. 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function 10 Sep 16:03:33 - [error] [matrix-receive:chp] TypeError: node.server.matrixClient.decryptEventIfNeeded is not a function

But I have been trying some of the simplier nodes matrix nodes, but they weren't quite right somehow, so I removed them from the palette and tried yours, since it seemed more complete. So maybe there is something left over from them....?

my settings look like this for recieve node: Name: chp Matrix Server: roll** Room ID: !fHspzJkhWYjdrn***:matrix.org Timeline event filters: all ticked Accept text m.text Accept emotes m.emote Accept stickers m.sticker Accept reactions m.reaction Accept files m.file Accept images m.image

then on the server setup:

Name: roll User ID: @roll:matrix.org Access Token: syt_cm9sbGVQHyjW_4UuWEo Device ID: blank Server URL: https://matrix.org auto join ticked nothing else ticked

node-red is ver 1.3.4 on ubuntu 20.04 I have not upgraded node-red to ver 2.x since I'm running node-red signal messaging node and think this only works on 1.x Although I have issues with signal in node-red and trying to move away from it since the Dev seems to have given up on it. Thanks for your reply, maybe I should try restarting node-red, although that does tend to mess up my other flows for awhile. Chris

cthompstone commented 2 years ago

really sorry..... Did a node-red restart and it's now working.... So maybe just needed a reset. Regards

skylord123 commented 2 years ago

really sorry..... Did a node-red restart and it's now working.... So maybe just needed a reset. Regards

No need to be sorry. I am glad you got it working. I'm still curious what broke it but being that it is now working we may never know. I would assume it has to do with the other matrix modules you installed and maybe they didn't get cleared out correctly by NPM.

If you have this problem again feel free to re-open this issue. I am going to close it for now since it is resolved. Glad you got it working!