Files
rmmanager/plugins/rmass/actions/synapsecreatespace.py
T

80 lines
1.6 KiB
Python

import os
name = "Synapse Create Space"
kind = "action"
showstatus = True
resolve = {
"get": {
#"sender": ["messages", 0, "senderId"],
#"username": ["profile", "username"],
"locationname": ["profile", "location"],
"locationcode": ["profile", "searchCity"],
},
"construct": {
"matrixspacealias": [
"rmass_space_",
{"resolved": "locationcode"},
#"%3Aloxthelion.com",
],
},
}
keys = [
{
"keytitle": "name",
"keyvalue": {
"resolved": "locationname",
},
},
{
"keytitle": "room_alias_name",
"keyvalue": {
"resolved": "matrixspacealias",
#"prefix": "rmass_space_",
},
},
{
"keytitle": "visibility",
"keyvalue": "private",
},
{
"keytitle": "creation_content",
"keyvalue": {
"type": "m.space",
},
},
{
"keytitle": "invite",
"keyvalue": ["@lyncoln:loxthelion.com"],
},
#{
#"keytitle": "power_level_content_override",
#"keyvalue": {
#"users": {
#"@lyncoln:loxthelion.com": 100,
#"@rmass_*:loxthelion.com": 100,
#},
#},
#}
]
method = "POST"
path = [
"https://loxthelion.com/_matrix/client/v3/createRoom?user_id=@rmass_bridge:loxthelion.com"
]
headers = {
"Authorization": {
"os": "AS_TOKEN",
"prefix": "Bearer ",
},
"Content-Type": "application/json",
}
outputs = {
"space_id": "room_id",
}