6dd2ec75f0
- Remove mention of Device ID being required for encryption (since it can now auto generate if not provided this could make people think they have to set it when that isn't the case) - matrix-js-sdk updated from ^v15.3.0 to ^v15.5.0 - got updated from ^11.8.2 to ^12.0.1 (this also required us to change how we import this library in code) - Node-RED version requirement added for >=v1.3.0 - NodeJS version requirement added for >=v14.0.0 - removed `process` dependency - send-image node fixed so error doesn't get thrown (`matrix-js-sdk` updated causing some errors) - updated send-image node docs to explain that msg.contentType is necessary for some clients to render the image (otherwise it could display as a blank message in the room). - If a matrix server configuration node was missing it's User ID it would throw a TypeError instead of telling the user the actual issue. - Updated user list example: it now paginates all users on the server (if you had a lot of users the message would fail to send because it was too large) - Added example for creating a room and inviting a user - Added example for joining a mentioned room - Added example for listing out a user's or server's rooms - Added example for getting session data from a user via whois info - Added example for getting a room's user list - Added example for downloading & storing received files/images - Added example for kicking/banning user from a room. - Added example for deactivating a user - Removed message in the room-users config stating it only works if you are an admin - Receive node now outputs `msg.filename` for files and images
153 lines
3.3 KiB
JSON
153 lines
3.3 KiB
JSON
[
|
|
{
|
|
"id": "93df869346a728d3",
|
|
"type": "comment",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "Response to \"whois <user_id>\" with user information",
|
|
"info": "",
|
|
"x": 610,
|
|
"y": 2360,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "656ed1e444fd2e0a",
|
|
"type": "function",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "",
|
|
"func": "let matches = msg.payload.match(/^whois ?(\\@.*)?/);\nmsg.userId = matches[1].trim() ? matches[1].trim() : msg.userId;\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 440,
|
|
"y": 2440,
|
|
"wires": [
|
|
[
|
|
"4869676dab929d20"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4869676dab929d20",
|
|
"type": "matrix-whois-user",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "",
|
|
"server": null,
|
|
"x": 590,
|
|
"y": 2440,
|
|
"wires": [
|
|
[
|
|
"a894fcabf9e41dca"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "a894fcabf9e41dca",
|
|
"type": "function",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "",
|
|
"func": "try { \n var sessions = msg.payload.devices[\"\"].sessions || null;\n} catch (error) { \n var sessions = null;\n}\nlet html = \"whois (session) information for <strong>\" + msg.userId + \"</strong>\\n<ol>\";\nfor(let session of sessions) {\n try { \n var connections = session.connections;\n } catch (error) { \n var connections = null;\n }\n for(let connection of connections) {\n html += \"\\n<li><pre><code>\"+JSON.stringify(connection, null, 2)+\"</code></pre></li>\"\n }\n}\nhtml += \"</ol>\"\nmsg.payload = html;\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 740,
|
|
"y": 2440,
|
|
"wires": [
|
|
[
|
|
"898b8974f2b24861"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "898b8974f2b24861",
|
|
"type": "matrix-send-message",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "Send HTML Notice",
|
|
"server": null,
|
|
"roomId": "",
|
|
"messageType": "m.notice",
|
|
"messageFormat": "html",
|
|
"x": 910,
|
|
"y": 2440,
|
|
"wires": [
|
|
[],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "c8855c79f194796e",
|
|
"type": "switch",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "is from me",
|
|
"property": "userId",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "@skylord123:skylar.tech",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 1,
|
|
"x": 590,
|
|
"y": 2400,
|
|
"wires": [
|
|
[
|
|
"ae1537a16b9e3b4c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "39109d4f02d241ca",
|
|
"type": "matrix-receive",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "",
|
|
"server": null,
|
|
"roomId": "",
|
|
"acceptText": true,
|
|
"acceptEmotes": true,
|
|
"acceptStickers": true,
|
|
"acceptReactions": true,
|
|
"acceptFiles": true,
|
|
"acceptImages": true,
|
|
"x": 420,
|
|
"y": 2400,
|
|
"wires": [
|
|
[
|
|
"c8855c79f194796e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ae1537a16b9e3b4c",
|
|
"type": "switch",
|
|
"z": "f025a8b9fbd1b054",
|
|
"name": "msg.payload filter",
|
|
"property": "payload",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "regex",
|
|
"v": "^whois",
|
|
"vt": "str",
|
|
"case": false
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 1,
|
|
"x": 770,
|
|
"y": 2400,
|
|
"wires": [
|
|
[
|
|
"656ed1e444fd2e0a"
|
|
]
|
|
]
|
|
}
|
|
] |