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

msg.userId error on Create a Room Node #14

Closed rodrigoscoelho closed 2 years ago

rodrigoscoelho commented 2 years ago

Hi, when using Create a Room, if I pass the msg.userId with the @username:localdomain.com it gives an error:

01/09/2021 00:17:12node: b091d5b78132f9ba msg : string[49] "Error creating room M_UNKNOWN: Invalid user_id: @" 01/09/2021 00:17:12node: a5158db78e8f294c msg : Object object _msgid: "6514ea2a9113c3e8" payload: object visibility: "public" preset: "private_chat" room_alias_name: "FTR0133" name: "FTR0133 - teste matrix2" topic: "Grupo criado automaticamente após a criação de um Centro de Custo no CRM" invite: "@rodrigocoelho:fratar.com.br" userId: "@rodrigocoelho:fratar.com.br" error: "M_UNKNOWN: Invalid user_id: @"

rodrigoscoelho commented 2 years ago

Found the error. It was on the invite inside the payload. It expected an array.

BUT, why is the msg.userId necessary for?? Thanks

skylord123 commented 2 years ago

This is actually just the node docs that are wrong. The only thing required to make a room is the msg.payload with an object containing keys/values just like described in the matrix docs: https://matrix.org/docs/spec/client_server/r0.4.0#post-matrix-client-r0-createroom

9 will be completed soon so all nodes will be correct. I'm fixing this so it will go out on the next release. Thanks for the issue! :)